This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-resolver.git


The following commit(s) were added to refs/heads/master by this push:
     new 042b777  SLING-9406 - Add bundled script support to the servlets 
resolver
042b777 is described below

commit 042b77741a40aac75eeb5d5447e3ef24cc057b43
Author: Karl Pauls <[email protected]>
AuthorDate: Mon May 25 02:02:42 2020 +0200

    SLING-9406 - Add bundled script support to the servlets resolver
    
    * Normalize the decorated path before lookup
---
 .../sling/servlets/resolver/internal/ScriptResourceDecorator.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sling/servlets/resolver/internal/ScriptResourceDecorator.java
 
b/src/main/java/org/apache/sling/servlets/resolver/internal/ScriptResourceDecorator.java
index a780b9a..035316f 100644
--- 
a/src/main/java/org/apache/sling/servlets/resolver/internal/ScriptResourceDecorator.java
+++ 
b/src/main/java/org/apache/sling/servlets/resolver/internal/ScriptResourceDecorator.java
@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceDecorator;
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
 import 
org.apache.sling.servlets.resolver.internal.resource.MergingServletResourceProvider;
 import org.apache.sling.spi.resource.provider.ResolveContext;
 import org.apache.sling.spi.resource.provider.ResourceContext;
@@ -43,7 +44,7 @@ public class ScriptResourceDecorator implements 
ResourceDecorator {
 
     @Override
     public Resource decorate(Resource resource) {
-        String path = resource.getPath();
+        String path = ResourceUtil.normalize(resource.getPath());
         String resolutionPath = 
resource.getResourceMetadata().getResolutionPath();
         Resource script = getResource(resource, path);
         if (script == resource && 
Resource.RESOURCE_TYPE_NON_EXISTING.equals(resource.getResourceType())) {

Reply via email to