incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r816585 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
Date Fri, 18 Sep 2009 11:33:46 GMT
Author: cziegeler
Date: Fri Sep 18 11:33:45 2009
New Revision: 816585

URL: http://svn.apache.org/viewvc?rev=816585&view=rev
Log:
SLING-1115 : Redirecting to an absolute url does not work

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

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java?rev=816585&r1=816584&r2=816585&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
Fri Sep 18 11:33:45 2009
@@ -123,6 +123,12 @@
      */
     protected static String toRedirectPath(String targetPath,
             SlingHttpServletRequest request) {
+        // first check for an absolute path
+        final int protocolIndex = targetPath.indexOf(":/");
+        final int queryIndex = targetPath.indexOf('?');
+        if (  protocolIndex > -1 && (queryIndex == -1 || queryIndex > protocolIndex)
) {
+            return targetPath;
+        }
 
         String postFix;
         RequestPathInfo rpi = request.getRequestPathInfo();



Mime
View raw message