- 
                Notifications
    
You must be signed in to change notification settings  - Fork 38.8k
 
Open
Labels
status: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided ontype: documentationA documentation taskA documentation task
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
status: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided ontype: documentationA documentation taskA documentation task