mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 05:49:04 +00:00
Fix ForwardedHeaderFilter preserves semicolon content
Previously a requestURI that contained ';' would have the value incorrectly stripped out when using ForwardedHeaderFilter. This commit ensures that the ';' is preserved when using ForwardedHeaderFilter. Issue: SPR-15428
This commit is contained in:
+11
@@ -171,6 +171,17 @@ public class ForwardedHeaderFilterTests {
|
||||
assertEquals("/", actual.getRequestURI());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void requestUriPreserveSemicolonContent() throws Exception {
|
||||
this.request.setContextPath("");
|
||||
this.request.setRequestURI("/path;a=b/with/semicolon");
|
||||
HttpServletRequest actual = filterAndGetWrappedRequest();
|
||||
|
||||
assertEquals("", actual.getContextPath());
|
||||
assertEquals("/path;a=b/with/semicolon", actual.getRequestURI());
|
||||
assertEquals("http://localhost/path;a=b/with/semicolon", actual.getRequestURL().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void caseInsensitiveForwardedPrefix() throws Exception {
|
||||
this.request = new MockHttpServletRequest() {
|
||||
|
||||
Reference in New Issue
Block a user