Fix invalid PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE

Prior to this commit, `AntPathMatcher.extractPathWithinPattern` would
not process correctly `**` patterns and would only match *one* path
segment in the given path.

This commit changes `extractPathWithinPattern` to allow multiple path
segments to be matched against a single `**` pattern segment.

Issue: SPR-10515
This commit is contained in:
Brian Clozel
2014-09-30 14:03:27 +02:00
parent 5f4eb4dd55
commit d293889bb3
2 changed files with 14 additions and 18 deletions

View File

@@ -294,6 +294,10 @@ public class AntPathMatcherTests {
assertEquals("/docs/commit.html", pathMatcher.extractPathWithinPattern("*.html", "/docs/commit.html"));
assertEquals("/docs/commit.html", pathMatcher.extractPathWithinPattern("**/*.*", "/docs/commit.html"));
assertEquals("/docs/commit.html", pathMatcher.extractPathWithinPattern("*", "/docs/commit.html"));
//SPR-10515
assertEquals("/docs/cvs/other/commit.html", pathMatcher.extractPathWithinPattern("**/commit.html", "/docs/cvs/other/commit.html"));
assertEquals("cvs/other/commit.html", pathMatcher.extractPathWithinPattern("/docs/**/commit.html", "/docs/cvs/other/commit.html"));
assertEquals("cvs/other/commit.html", pathMatcher.extractPathWithinPattern("/docs/**/**/**/**", "/docs/cvs/other/commit.html"));
assertEquals("docs/cvs/commit", pathMatcher.extractPathWithinPattern("/d?cs/*", "/docs/cvs/commit"));
assertEquals("cvs/commit.html",