Browse Source

AntPathMatcher allows newline in URI template variables

Closes gh-23252
pull/26087/head
Rossen Stoyanchev 4 years ago
parent
commit
b92d249f45
  1. 2
      spring-core/src/main/java/org/springframework/util/AntPathMatcher.java
  2. 1
      spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java

2
spring-core/src/main/java/org/springframework/util/AntPathMatcher.java

@ -644,7 +644,7 @@ public class AntPathMatcher implements PathMatcher { @@ -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;

1
spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java

@ -130,6 +130,7 @@ class AntPathMatcherTests { @@ -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

Loading…
Cancel
Save