Use correct method to check encoded resource path

Closes: gh-33568
This commit is contained in:
Andrey Popov 2024-09-19 15:29:29 +04:00 committed by rstoyanchev
parent 776811bdb8
commit 94c04821ff
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,7 @@ class PathResourceLookupFunction implements Function<ServerRequest, Mono<Resourc
return true;
}
locationPath = (locationPath.endsWith("/") || locationPath.isEmpty() ? locationPath : locationPath + "/");
return (resourcePath.startsWith(locationPath) && !isInvalidEncodedInputPath(resourcePath));
return (resourcePath.startsWith(locationPath) && !isInvalidEncodedResourcePath(resourcePath));
}
private boolean isInvalidEncodedResourcePath(String resourcePath) {