Add test to ensure ForwardedHeaderFilter contextPath preserves encoding
Add a test to verify that the ForwardedHeaderFilter contextPath override preserves URL encoding as it should. Issue SPR-15422
This commit is contained in:
@@ -245,6 +245,17 @@ public class ForwardedHeaderFilterTests {
|
||||
assertEquals("/prefix", actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void contextPathPreserveEncoding() throws Exception {
|
||||
this.request.setContextPath("/app%20");
|
||||
this.request.setRequestURI("/app%20/path/");
|
||||
HttpServletRequest actual = filterAndGetWrappedRequest();
|
||||
|
||||
assertEquals("/app%20", actual.getContextPath());
|
||||
assertEquals("/app%20/path/", actual.getRequestURI());
|
||||
assertEquals("http://localhost/app%20/path/", actual.getRequestURL().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sendRedirectWithAbsolutePath() throws Exception {
|
||||
this.request.addHeader(X_FORWARDED_PROTO, "https");
|
||||
|
||||
Reference in New Issue
Block a user