incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1584519 - /sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/DefaultAuthenticationFeedbackHandler.java
Date Fri, 04 Apr 2014 05:10:52 GMT
Author: cziegeler
Date: Fri Apr  4 05:10:52 2014
New Revision: 1584519

URL: http://svn.apache.org/r1584519
Log:
SLING-3488 : Redirect after authentication breaks with context path

Modified:
    sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/DefaultAuthenticationFeedbackHandler.java

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/DefaultAuthenticationFeedbackHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/DefaultAuthenticationFeedbackHandler.java?rev=1584519&r1=1584518&r2=1584519&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/DefaultAuthenticationFeedbackHandler.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/DefaultAuthenticationFeedbackHandler.java
Fri Apr  4 05:10:52 2014
@@ -115,6 +115,11 @@ public class DefaultAuthenticationFeedba
             redirect = ResourceUtil.normalize(redirect);
         }
 
+        // prepend context path if necessary
+        if (redirect.startsWith("/") && !redirect.startsWith(request.getContextPath()))
{
+            redirect = request.getContextPath().concat(redirect);
+        }
+
         // absolute target (in the servlet context)
         if (!AuthUtil.isRedirectValid(request, redirect)) {
             LoggerFactory.getLogger(DefaultAuthenticationFeedbackHandler.class).error(
@@ -123,7 +128,7 @@ public class DefaultAuthenticationFeedba
             redirect = "/";
         }
 
-        return request.getContextPath().concat(redirect);
+        return redirect;
     }
 
     /**



Mime
View raw message