Author: markt
Date: Wed Oct 15 13:20:02 2014
New Revision: 1632012
URL: http://svn.apache.org/r1632012
Log:
Simplify code
Modified:
tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
Modified:
tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java?rev=1632012&r1=1632011&r2=1632012&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
Wed Oct 15 13:20:02 2014
@@ -446,12 +446,12 @@ public abstract class AuthenticatorBase
// where the login form (and therefore the "j_security_check" URI
// to which it submits) might be outside the secured area
String contextPath = this.context.getPath();
- String requestURI = request.getDecodedRequestURI();
- if (requestURI.startsWith(contextPath) &&
- requestURI.endsWith(Constants.FORM_ACTION)) {
+ String decodedRequestURI = request.getDecodedRequestURI();
+ if (decodedRequestURI.startsWith(contextPath) &&
+ decodedRequestURI.endsWith(Constants.FORM_ACTION)) {
if (!authenticate(request, response)) {
if (log.isDebugEnabled()) {
- log.debug(" Failed authenticate() test ??" + requestURI );
+ log.debug(" Failed authenticate() test ??" +
decodedRequestURI );
}
return;
}
@@ -467,23 +467,18 @@ public abstract class AuthenticatorBase
if (session != null) {
SavedRequest savedRequest =
(SavedRequest)
session.getNote(Constants.FORM_REQUEST_NOTE);
- if (savedRequest != null) {
- String decodedRequestURI = request.getDecodedRequestURI();
- if (decodedRequestURI != null &&
- decodedRequestURI.equals(
- savedRequest.getDecodedRequestURI())) {
- if (!authenticate(request, response)) {
- if (log.isDebugEnabled()) {
- log.debug(" Failed authenticate() test");
- }
- /*
- * ASSERT: Authenticator already set the appropriate
- * HTTP status code, so we do not have to do anything
- * special
- */
- return;
- }
+ if (savedRequest != null &&
+
decodedRequestURI.equals(savedRequest.getDecodedRequestURI()) &&
+ !authenticate(request, response)) {
+ if (log.isDebugEnabled()) {
+ log.debug(" Failed authenticate() test");
}
+ /*
+ * ASSERT: Authenticator already set the appropriate
+ * HTTP status code, so we do not have to do anything
+ * special
+ */
+ return;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]