Skip to content

Commit b65bfdb

Browse files
committed
Remove HttpRequestPathHelper
The use of the undecoded URL path by default and the removal of suffix pattern matching effectively means HttpRequestPathHelper is no longer needed. Issue: SPR-15640, SPR-15639
1 parent 95196e1 commit b65bfdb

File tree

10 files changed

+43
-323
lines changed

10 files changed

+43
-323
lines changed

spring-web/src/main/java/org/springframework/web/server/support/HttpRequestPathHelper.java

Lines changed: 0 additions & 153 deletions
This file was deleted.

spring-web/src/main/java/org/springframework/web/server/support/package-info.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

spring-web/src/test/java/org/springframework/web/server/support/HttpRequestPathHelperTests.java

Lines changed: 0 additions & 82 deletions
This file was deleted.

spring-webflux/src/main/java/org/springframework/web/reactive/config/PathMatchConfigurer.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import org.springframework.lang.Nullable;
2020
import org.springframework.util.PathMatcher;
21-
import org.springframework.web.server.support.HttpRequestPathHelper;
2221
import org.springframework.web.util.pattern.ParsingPathMatcher;
2322

2423
/**
@@ -35,8 +34,6 @@ public class PathMatchConfigurer {
3534

3635
private Boolean registeredSuffixPatternMatch;
3736

38-
private HttpRequestPathHelper pathHelper;
39-
4037
private PathMatcher pathMatcher;
4138

4239

@@ -73,15 +70,6 @@ public PathMatchConfigurer setUseRegisteredSuffixPatternMatch(Boolean registered
7370
return this;
7471
}
7572

76-
/**
77-
* Set a {@code HttpRequestPathHelper} for the resolution of lookup paths.
78-
* <p>Default is {@code HttpRequestPathHelper}.
79-
*/
80-
public PathMatchConfigurer setPathHelper(HttpRequestPathHelper pathHelper) {
81-
this.pathHelper = pathHelper;
82-
return this;
83-
}
84-
8573
/**
8674
* Set the PathMatcher for matching URL paths against registered URL patterns.
8775
* <p>The default is a {@link org.springframework.web.util.pattern.ParsingPathMatcher}.
@@ -106,11 +94,6 @@ protected Boolean isUseRegisteredSuffixPatternMatch() {
10694
return this.registeredSuffixPatternMatch;
10795
}
10896

109-
@Nullable
110-
protected HttpRequestPathHelper getPathHelper() {
111-
return this.pathHelper;
112-
}
113-
11497
@Nullable
11598
public PathMatcher getPathMatcher() {
11699
if (this.pathMatcher instanceof ParsingPathMatcher && (this.trailingSlashMatch || this.suffixPatternMatch)) {

spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,10 @@ public RequestMappingHandlerMapping requestMappingHandlerMapping() {
133133
if (useTrailingSlashMatch != null) {
134134
mapping.setUseTrailingSlashMatch(useTrailingSlashMatch);
135135
}
136-
137-
HttpRequestPathHelper pathHelper = configurer.getPathHelper();
138-
if (pathHelper != null) {
139-
mapping.setPathHelper(pathHelper);
140-
}
141136
PathMatcher pathMatcher = configurer.getPathMatcher();
142137
if (pathMatcher != null) {
143138
mapping.setPathMatcher(pathMatcher);
144139
}
145-
146140
return mapping;
147141
}
148142

@@ -251,9 +245,6 @@ public HandlerMapping resourceHandlerMapping() {
251245
if (pathMatchConfigurer.getPathMatcher() != null) {
252246
handlerMapping.setPathMatcher(pathMatchConfigurer.getPathMatcher());
253247
}
254-
if (pathMatchConfigurer.getPathHelper() != null) {
255-
handlerMapping.setPathHelper(pathMatchConfigurer.getPathHelper());
256-
}
257248
}
258249
else {
259250
handlerMapping = new EmptyHandlerMapping();

spring-webflux/src/main/java/org/springframework/web/reactive/handler/AbstractHandlerMapping.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.springframework.web.reactive.HandlerMapping;
3535
import org.springframework.web.server.ServerWebExchange;
3636
import org.springframework.web.server.WebHandler;
37-
import org.springframework.web.server.support.HttpRequestPathHelper;
3837
import org.springframework.web.util.pattern.ParsingPathMatcher;
3938

4039
/**
@@ -53,8 +52,6 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport im
5352

5453
private int order = Integer.MAX_VALUE; // default: same as non-Ordered
5554

56-
private HttpRequestPathHelper pathHelper = new HttpRequestPathHelper();
57-
5855
private PathMatcher pathMatcher = new ParsingPathMatcher();
5956

6057
private final UrlBasedCorsConfigurationSource globalCorsConfigSource = new UrlBasedCorsConfigurationSource();
@@ -76,33 +73,6 @@ public final int getOrder() {
7673
return this.order;
7774
}
7875

79-
/**
80-
* Set if the path should be URL-decoded. This sets the same property on the
81-
* underlying path helper.
82-
* @see HttpRequestPathHelper#setUrlDecode(boolean)
83-
*/
84-
public void setUrlDecode(boolean urlDecode) {
85-
this.pathHelper.setUrlDecode(urlDecode);
86-
}
87-
88-
/**
89-
* Set the {@link HttpRequestPathHelper} to use for resolution of lookup
90-
* paths. Use this to override the default implementation with a custom
91-
* subclass or to share common path helper settings across multiple
92-
* HandlerMappings.
93-
*/
94-
public void setPathHelper(HttpRequestPathHelper pathHelper) {
95-
this.pathHelper = pathHelper;
96-
}
97-
98-
/**
99-
* Return the {@link HttpRequestPathHelper} implementation to use for
100-
* resolution of lookup paths.
101-
*/
102-
public HttpRequestPathHelper getPathHelper() {
103-
return this.pathHelper;
104-
}
105-
10676
/**
10777
* Set the PathMatcher implementation to use for matching URL paths
10878
* against registered URL patterns.

0 commit comments

Comments
 (0)