Remove WebFlux trailing slash match

See gh-34036
This commit is contained in:
rstoyanchev
2024-12-13 14:10:19 +00:00
parent 4fd368b1af
commit 32db1a1680
5 changed files with 1 additions and 111 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@ import java.util.Map;
import java.util.function.Predicate;
import org.springframework.lang.Nullable;
import org.springframework.web.util.pattern.PathPatternParser;
/**
* Assist with configuring {@code HandlerMapping}'s with path matching options.
@@ -32,10 +31,6 @@ import org.springframework.web.util.pattern.PathPatternParser;
*/
public class PathMatchConfigurer {
@Nullable
private Boolean trailingSlashMatch;
@Nullable
private Boolean caseSensitiveMatch;
@@ -53,20 +48,6 @@ public class PathMatchConfigurer {
return this;
}
/**
* Whether to match to URLs irrespective of the presence of a trailing slash.
* If enabled a method mapped to "/users" also matches to "/users/".
* <p>The default was changed in 6.0 from {@code true} to {@code false} in
* order to support the deprecation of the property.
* @deprecated as of 6.0, see
* {@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)}
*/
@Deprecated(since = "6.0")
public PathMatchConfigurer setUseTrailingSlashMatch(Boolean trailingSlashMatch) {
this.trailingSlashMatch = trailingSlashMatch;
return this;
}
/**
* Configure a path prefix to apply to matching controller methods.
* <p>Prefixes are used to enrich the mappings of every {@code @RequestMapping}
@@ -87,12 +68,6 @@ public class PathMatchConfigurer {
}
@Nullable
@Deprecated
protected Boolean isUseTrailingSlashMatch() {
return this.trailingSlashMatch;
}
@Nullable
protected Boolean isUseCaseSensitiveMatch() {
return this.caseSensitiveMatch;

View File

@@ -154,13 +154,8 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
return mapping;
}
@SuppressWarnings("deprecation")
private void configureAbstractHandlerMapping(AbstractHandlerMapping mapping, PathMatchConfigurer configurer) {
mapping.setCorsConfigurations(getCorsConfigurations());
Boolean useTrailingSlashMatch = configurer.isUseTrailingSlashMatch();
if (useTrailingSlashMatch != null) {
mapping.setUseTrailingSlashMatch(useTrailingSlashMatch);
}
Boolean useCaseSensitiveMatch = configurer.isUseCaseSensitiveMatch();
if (useCaseSensitiveMatch != null) {
mapping.setUseCaseSensitiveMatch(useCaseSensitiveMatch);

View File

@@ -85,24 +85,6 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
this.patternParser.setCaseSensitive(caseSensitiveMatch);
}
/**
* Shortcut method for setting the same property on the underlying pattern
* parser in use. For more details see:
* <ul>
* <li>{@link #getPathPatternParser()} -- the underlying pattern parser
* <li>{@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)} --
* the trailing slash option, including its default value.
* </ul>
* <p>The default was changed in 6.0 from {@code true} to {@code false} in
* order to support the deprecation of the property.
* @deprecated as of 6.0, see
* {@link PathPatternParser#setMatchOptionalTrailingSeparator(boolean)}
*/
@Deprecated(since = "6.0")
public void setUseTrailingSlashMatch(boolean trailingSlashMatch) {
this.patternParser.setMatchOptionalTrailingSeparator(trailingSlashMatch);
}
/**
* Return the {@link PathPatternParser} instance that is used for
* {@link #setCorsConfigurations(Map) CORS configuration checks}.