See gh-28041
This commit is contained in:
Brian Clozel 2023-10-20 18:31:37 +02:00
parent 4bf995fa8b
commit dab7e03c93
2 changed files with 6 additions and 2 deletions

View File

@ -49,9 +49,9 @@ final class MockMvcFilterDecorator implements Filter {
private static final String ALL_MAPPING_PATTERN = "*";
private static final String EXTENSION_MAPPING_PATTERN = ALL_MAPPING_PATTERN + ".";
private static final String EXTENSION_MAPPING_PATTERN = "*.";
private static final String PATH_MAPPING_PATTERN = "/" + ALL_MAPPING_PATTERN;
private static final String PATH_MAPPING_PATTERN = "/*";
private final Filter delegate;

View File

@ -90,21 +90,25 @@ public class MockMvcFilterDecoratorTests {
@Test
public void matchPathMappingAllFolder() throws Exception {
assertFilterInvoked("/test/this", "*");
assertFilterInvoked("/test/this", "/*");
}
@Test
public void matchPathMappingAll() throws Exception {
assertFilterInvoked("/test", "*");
assertFilterInvoked("/test", "/*");
}
@Test
public void matchPathMappingAllContextRoot() throws Exception {
assertFilterInvoked("", "*");
assertFilterInvoked("", "/*");
}
@Test
public void matchPathMappingContextRootAndSlash() throws Exception {
assertFilterInvoked("/", "*");
assertFilterInvoked("/", "/*");
}