incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r966412 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
Date Wed, 21 Jul 2010 20:47:08 GMT
Author: justin
Date: Wed Jul 21 20:47:08 2010
New Revision: 966412

URL: http://svn.apache.org/viewvc?rev=966412&view=rev
Log:
SLING-1610 - adding check for mapped path

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java?rev=966412&r1=966411&r2=966412&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRendererServlet.java
Wed Jul 21 20:47:08 2010
@@ -123,7 +123,7 @@ public class StreamRendererServlet exten
         } else {
 
             // the resource is the root, do not redirect, immediately index
-            if ("/".equals(resource.getPath())) {
+            if (isRootResourceRequest(resource)) {
 
                 renderDirectory(request, response, included);
 
@@ -146,6 +146,11 @@ public class StreamRendererServlet exten
         }
     }
 
+    private boolean isRootResourceRequest(Resource resource) {
+        return ("/".equals(resource.getPath())) ||
+            ("/".equals(resource.getResourceResolver().map(resource.getPath())));
+    }
+
     /**
      * Returns <code>true</code> if the request has a
      * <code>If-Modified-Since</code> header whose date value is later than the



Mime
View raw message