Skip to content

Commit 1966ff3

Browse files
committed
Parse RequestPath when cache is empty
Closes gh-16771
1 parent 861a9a9 commit 1966ff3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web/src/main/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,15 @@ void setServletPath(RequestMatcher servletPath) {
127127
}
128128

129129
private RequestPath getRequestPath(HttpServletRequest request) {
130+
RequestPath path;
130131
if (ServletRequestPathUtils.hasParsedRequestPath(request)) {
131-
return ServletRequestPathUtils.getParsedRequestPath(request);
132+
path = ServletRequestPathUtils.getParsedRequestPath(request);
132133
}
133134
else {
134-
return ServletRequestPathUtils.parseAndCache(request);
135+
path = ServletRequestPathUtils.parseAndCache(request);
136+
ServletRequestPathUtils.clearParsedRequestPath(request);
135137
}
138+
return path;
136139
}
137140

138141
/**

0 commit comments

Comments
 (0)