AntPathMatcher allows newline in URI template variables

Closes gh-23252
This commit is contained in:
Rossen Stoyanchev 2020-11-12 22:00:47 +00:00
parent 204a7fe91f
commit b92d249f45
2 changed files with 2 additions and 1 deletions

View File

@ -644,7 +644,7 @@ public class AntPathMatcher implements PathMatcher {
private static final Pattern GLOB_PATTERN = Pattern.compile("\\?|\\*|\\{((?:\\{[^/]+?}|[^/{}]|\\\\[{}])+?)}");
private static final String DEFAULT_VARIABLE_PATTERN = "(.*)";
private static final String DEFAULT_VARIABLE_PATTERN = "((?s).*)";
private final String rawPattern;

View File

@ -130,6 +130,7 @@ class AntPathMatcherTests {
assertThat(pathMatcher.match("", "")).isTrue();
assertThat(pathMatcher.match("/{bla}.*", "/testing.html")).isTrue();
assertThat(pathMatcher.match("/{bla}", "//x\ny")).isTrue();
}
@Test