Normalize static resource path early
Rather than leaving it to the Resource implementation, and potentially normalizing twice, we apply it once as part of the initial processPath checks. Closes gh-33689
This commit is contained in:
@@ -670,7 +670,6 @@ class ResourceWebHandlerTests {
|
||||
testInvalidPath("/../.." + secretPath, handler);
|
||||
testInvalidPath("/%2E%2E/testsecret/secret.txt", handler);
|
||||
testInvalidPath("/%2E%2E/testsecret/secret.txt", handler);
|
||||
testInvalidPath("%2F%2F%2E%2E%2F%2F%2E%2E" + secretPath, handler);
|
||||
}
|
||||
|
||||
private void testInvalidPath(String requestPath, ResourceWebHandler handler) {
|
||||
@@ -705,7 +704,6 @@ class ResourceWebHandlerTests {
|
||||
testResolvePathWithTraversal(method, "/url:" + secretPath);
|
||||
testResolvePathWithTraversal(method, "////../.." + secretPath);
|
||||
testResolvePathWithTraversal(method, "/%2E%2E/testsecret/secret.txt");
|
||||
testResolvePathWithTraversal(method, "%2F%2F%2E%2E%2F%2Ftestsecret/secret.txt");
|
||||
testResolvePathWithTraversal(method, "url:" + secretPath);
|
||||
|
||||
// The following tests fail with a MalformedURLException on Windows
|
||||
|
||||
Reference in New Issue
Block a user