From 3bfbe30a7814c9ea1556d40df9bd87ddb3ba372d Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Mon, 14 Oct 2024 12:55:18 +0100 Subject: [PATCH] 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 --- .../server/PathResourceLookupFunction.java | 23 +++++++++++++++---- .../reactive/resource/ResourceWebHandler.java | 20 ++++++++++++++-- .../resource/ResourceWebHandlerTests.java | 2 -- .../function/PathResourceLookupFunction.java | 20 ++++++++++++++-- .../resource/ResourceHttpRequestHandler.java | 20 ++++++++++++++-- .../ResourceHttpRequestHandlerTests.java | 1 - 6 files changed, 72 insertions(+), 14 deletions(-) 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 aa314b6235..2f0d5fd108 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 @@ -104,7 +104,8 @@ class PathResourceLookupFunction implements Function