incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1210929 - /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
Date Tue, 06 Dec 2011 14:25:33 GMT
Author: fmeschbe
Date: Tue Dec  6 14:25:33 2011
New Revision: 1210929

URL: http://svn.apache.org/viewvc?rev=1210929&view=rev
Log:
SLING-2251 Apply patch by Alex Klimetscheck (Thanks)
  - Do not force the redirect path to be an absolute URL rather leverage
    the resource resolver to potentially return a relative URL

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=1210929&r1=1210928&r2=1210929&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
Tue Dec  6 14:25:33 2011
@@ -226,15 +226,8 @@ public class RedirectServlet extends Sli
 
         appendSelectorsExtensionSuffixQuery(request, target);
 
-        // return the mapped full path and return if already an absolute URI
-        final String finalTarget = request.getResourceResolver().map(request, target.toString());
-        if (isUrl(finalTarget)) {
-            return finalTarget;
-        }
-
-        // otherwise prepend the current request's information
-        return toAbsoluteUri(request.getScheme(), request.getServerName(),
-            request.getServerPort(), finalTarget);
+        // return the mapped full path
+        return request.getResourceResolver().map(request, target.toString());
     }
 
     /**



Mime
View raw message