Improve HTTP redirect URL encoding.
This commit is contained in:
parent
d5c14142d1
commit
0cbea9b452
|
@ -117,6 +117,7 @@ public class RetryWithHttpEntryPoint implements InitializingBean,
|
||||||
logger.debug("Redirecting to: " + redirectUrl);
|
logger.debug("Redirecting to: " + redirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
((HttpServletResponse) response).sendRedirect(redirectUrl);
|
((HttpServletResponse) response).sendRedirect(((HttpServletResponse) response)
|
||||||
|
.encodeRedirectURL(redirectUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class RetryWithHttpsEntryPoint implements InitializingBean,
|
||||||
logger.debug("Redirecting to: " + redirectUrl);
|
logger.debug("Redirecting to: " + redirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
((HttpServletResponse) response).sendRedirect(redirectUrl);
|
((HttpServletResponse) response).sendRedirect(((HttpServletResponse) response)
|
||||||
|
.encodeRedirectURL(redirectUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,8 +224,8 @@ public abstract class AbstractProcessingFilter implements Filter,
|
||||||
failed);
|
failed);
|
||||||
httpRequest.getSession().setAttribute(HttpSessionIntegrationFilter.ACEGI_SECURITY_AUTHENTICATION_KEY,
|
httpRequest.getSession().setAttribute(HttpSessionIntegrationFilter.ACEGI_SECURITY_AUTHENTICATION_KEY,
|
||||||
null);
|
null);
|
||||||
httpResponse.sendRedirect(httpRequest.getContextPath()
|
httpResponse.sendRedirect(httpResponse.encodeRedirectURL(httpRequest
|
||||||
+ authenticationFailureUrl);
|
.getContextPath() + authenticationFailureUrl));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ public abstract class AbstractProcessingFilter implements Filter,
|
||||||
+ targetUrl);
|
+ targetUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
httpResponse.sendRedirect(targetUrl);
|
httpResponse.sendRedirect(httpResponse.encodeRedirectURL(targetUrl));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,6 +176,7 @@ public class AuthenticationProcessingFilterEntryPoint
|
||||||
logger.debug("Redirecting to: " + redirectUrl);
|
logger.debug("Redirecting to: " + redirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
((HttpServletResponse) response).sendRedirect(redirectUrl);
|
((HttpServletResponse) response).sendRedirect(((HttpServletResponse) response)
|
||||||
|
.encodeRedirectURL(redirectUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String encodeRedirectURL(String arg0) {
|
public String encodeRedirectURL(String arg0) {
|
||||||
throw new UnsupportedOperationException("mock method not implemented");
|
return arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String encodeRedirectUrl(String arg0) {
|
public String encodeRedirectUrl(String arg0) {
|
||||||
|
|
Loading…
Reference in New Issue