Refine AntPathMatcher.combine when p1 contains '.'
Refine AntPathMatcher.combine rules to allow direct concatenation of
patterns when pattern1 does not contain '*.'. Prior to this commit
direct concatenation was allowed when pattern1 did not contain '.',
this prevented calls of the form:
pathMatcher.combine("/1.0", "/foo/test")
from working as expected.
This commit also applies some general cleanup to the `combine` method.
Issue: SPR-10554
This commit is contained in:
@@ -399,6 +399,7 @@ public class AntPathMatcherTests {
|
||||
assertEquals("/hotels/**/booking", pathMatcher.combine("/hotels/**", "/booking"));
|
||||
assertEquals("/hotels/booking", pathMatcher.combine("/hotels", "/booking"));
|
||||
assertEquals("/hotels/booking", pathMatcher.combine("/hotels", "booking"));
|
||||
assertEquals("/hotels/booking", pathMatcher.combine("/hotels/", "booking"));
|
||||
assertEquals("/hotels/{hotel}", pathMatcher.combine("/hotels/*", "{hotel}"));
|
||||
assertEquals("/hotels/**/{hotel}", pathMatcher.combine("/hotels/**", "{hotel}"));
|
||||
assertEquals("/hotels/{hotel}", pathMatcher.combine("/hotels", "{hotel}"));
|
||||
@@ -413,6 +414,7 @@ public class AntPathMatcherTests {
|
||||
assertEquals("/{foo}/bar", pathMatcher.combine("/{foo}", "/bar")); // SPR-8858
|
||||
assertEquals("/user/user", pathMatcher.combine("/user", "/user")); // SPR-7970
|
||||
assertEquals("/{foo:.*[^0-9].*}/edit/", pathMatcher.combine("/{foo:.*[^0-9].*}", "/edit/")); // SPR-10062
|
||||
assertEquals("/1.0/foo/test", pathMatcher.combine("/1.0", "/foo/test")); // SPR-10554
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user