incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1060684 - /sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AbstractAuthenticationFormServlet.java
Date Wed, 19 Jan 2011 05:45:57 GMT
Author: justin
Date: Wed Jan 19 05:45:57 2011
New Revision: 1060684

URL: http://svn.apache.org/viewvc?rev=1060684&view=rev
Log:
better fix for SLING-1932

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

Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AbstractAuthenticationFormServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AbstractAuthenticationFormServlet.java?rev=1060684&r1=1060683&r2=1060684&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AbstractAuthenticationFormServlet.java
(original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/spi/AbstractAuthenticationFormServlet.java
Wed Jan 19 05:45:57 2011
@@ -187,7 +187,14 @@ public abstract class AbstractAuthentica
             b.append(resource);
         }
         String contextPath = b.toString();
-        return contextPath.equals("/") ? "" : contextPath;
+        return removeEndingSlash(contextPath);
+    }
+
+    private static String removeEndingSlash(String str) {
+        if(str != null && str.endsWith("/")) {
+            return str.substring(0, str.length() - 1);
+        }
+        return str;
     }
 
     /**



Mime
View raw message