You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2015/12/03 13:03:22 UTC
svn commit: r1717740 -
/tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
Author: remm
Date: Thu Dec 3 12:03:22 2015
New Revision: 1717740
URL: http://svn.apache.org/viewvc?rev=1717740&view=rev
Log:
Forgot to replicate the root redirect in the jaspic form code.
Modified:
tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
Modified: tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java?rev=1717740&r1=1717739&r2=1717740&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java (original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/jaspic/provider/modules/FormAuthModule.java Thu Dec 3 12:03:22 2015
@@ -113,6 +113,19 @@ public class FormAuthModule extends Tomc
}
if (!isLoginActionRequest(request)) {
+ // If this request was to the root of the context without a trailing
+ // '/', need to redirect to add it else the submit of the login form
+ // may not go to the correct web application
+ if (request.getServletPath().length() == 0 && request.getPathInfo() == null) {
+ StringBuilder location = new StringBuilder(request.getDecodedRequestURI());
+ location.append('/');
+ if (request.getQueryString() != null) {
+ location.append('?');
+ location.append(request.getQueryString());
+ }
+ response.sendRedirect(response.encodeRedirectURL(location.toString()));
+ return AuthStatus.SEND_CONTINUE;
+ }
return handleRedirectToLoginPage(request, response);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org