mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-03 11:51:33 +01:00
Allow subpath H2 console matching
Fixes gh-11926
This commit is contained in:
+2
-1
@@ -70,7 +70,8 @@ public final class PathRequest {
|
||||
|
||||
@Override
|
||||
protected void initialized(H2ConsoleProperties h2ConsoleProperties) {
|
||||
this.delegate = new AntPathRequestMatcher(h2ConsoleProperties.getPath());
|
||||
this.delegate = new AntPathRequestMatcher(
|
||||
h2ConsoleProperties.getPath() + "/**");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
@@ -47,6 +47,7 @@ public class PathRequestTests {
|
||||
public void toH2ConsoleShouldMatchH2ConsolePath() {
|
||||
RequestMatcher matcher = PathRequest.toH2Console();
|
||||
assertMatcher(matcher).matches("/h2-console");
|
||||
assertMatcher(matcher).matches("/h2-console/subpath");
|
||||
assertMatcher(matcher).doesNotMatch("/js/file.js");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user