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:
parent
46cf4f9ba1
commit
0a9f98f0df
|
|
@ -249,6 +249,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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue