From 21fe6cf8bd12b785cb84b6308842664c08a2f516 Mon Sep 17 00:00:00 2001 From: Andrey Popov Date: Thu, 19 Sep 2024 15:29:29 +0400 Subject: [PATCH] Use correct method to check encoded resource path Closes: gh-33568 (cherry picked from commit 94c04821ffcf0935077d0bf49c7467a12009806f) --- .../reactive/function/server/PathResourceLookupFunction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java index 22798eda937d..542c1ad8d5e1 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/PathResourceLookupFunction.java @@ -213,7 +213,7 @@ else if (resource instanceof ClassPathResource) { 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) {