PathPattern does not use custom separator
Prior to this commit, `PathPattern::extractPathWithinMapping` would always use the default path pattern separator `/` when extracting the path within the pattern of a matched route. This commit ensures that `PathPattern` uses the configured separator when extracting the path within the matched mapping. Fixes gh-23168
This commit is contained in:
@@ -707,6 +707,17 @@ public class PathPatternTests {
|
||||
checkExtractPathWithinPattern("/", "//", "");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void extractPathWithinPatternCustomSeparator() {
|
||||
PathPatternParser ppp = new PathPatternParser();
|
||||
ppp.setSeparator('.');
|
||||
PathPattern pp = ppp.parse("test.**");
|
||||
PathContainer pathContainer = PathContainer.parsePath("test.projects..spring-framework", ".");
|
||||
PathContainer result = pp.extractPathWithinPattern(pathContainer);
|
||||
assertThat(result.value()).isEqualTo("projects.spring-framework");
|
||||
assertThat(result.elements()).hasSize(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void extractUriTemplateVariables_spr15264() {
|
||||
PathPattern pp;
|
||||
|
||||
Reference in New Issue
Block a user