mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 14:52:24 +00:00
Remove use of HttpRequestPathHelper
Fixes gh-4387
This commit is contained in:
parent
6428cb411e
commit
554768f1e4
@ -26,8 +26,6 @@ import org.springframework.util.AntPathMatcher;
|
|||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.PathMatcher;
|
import org.springframework.util.PathMatcher;
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
import org.springframework.web.server.support.HttpRequestPathHelper;
|
|
||||||
import org.springframework.web.server.support.LookupPath;
|
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,8 +33,6 @@ import reactor.core.publisher.Mono;
|
|||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public final class PathMatcherServerWebExchangeMatcher implements ServerWebExchangeMatcher {
|
public final class PathMatcherServerWebExchangeMatcher implements ServerWebExchangeMatcher {
|
||||||
private HttpRequestPathHelper helper = new HttpRequestPathHelper();
|
|
||||||
|
|
||||||
private PathMatcher pathMatcher = new AntPathMatcher();
|
private PathMatcher pathMatcher = new AntPathMatcher();
|
||||||
|
|
||||||
private final String pattern;
|
private final String pattern;
|
||||||
@ -58,8 +54,7 @@ public final class PathMatcherServerWebExchangeMatcher implements ServerWebExcha
|
|||||||
if(this.method != null && !this.method.equals(request.getMethod())) {
|
if(this.method != null && !this.method.equals(request.getMethod())) {
|
||||||
return MatchResult.notMatch();
|
return MatchResult.notMatch();
|
||||||
}
|
}
|
||||||
LookupPath lookupPath = helper.getLookupPathForRequest(exchange);
|
String path = request.getPathWithinApplication();
|
||||||
String path = lookupPath.getPath();
|
|
||||||
boolean match = pathMatcher.match(pattern, path);
|
boolean match = pathMatcher.match(pattern, path);
|
||||||
if(!match) {
|
if(!match) {
|
||||||
return MatchResult.notMatch();
|
return MatchResult.notMatch();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user