-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation taskA documentation task
Milestone
Description
It looks like that PathPattern works inconsistently whit with * and ** rules in matching a string without trailing '/
For example:
/resources/* matches /resources/path but not /resources
/resources/** matches both /resources/path AND /resources
The same holds also for {path} and {*path}, but at least the behavior is documented for {*path}.
I wonder if this ambiguity is by design or if it can be considered a bug.
If this is the expected behavior, it would be good to document it also for **.
Can be reproduced with the following test
@Test
void myTest() {
HttpServletRequest request = new MockHttpServletRequest("GET", "/resources");
assertFalse(PathPatternRequestMatcher.pathPattern("/resources/*").matches(request));
assertFalse(PathPatternRequestMatcher.pathPattern("/resources/{path}").matches(request));
// The following assertions fail
assertFalse(PathPatternRequestMatcher.pathPattern("/resources/**").matches(request));
assertFalse(PathPatternRequestMatcher.pathPattern("/resources/{*path}").matches(request));
}Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: documentationA documentation taskA documentation task