@@ -129,11 +129,19 @@ public void getRequestRemoveSemicolonContent() throws UnsupportedEncodingExcepti
129
129
public void getRequestKeepSemicolonContent () {
130
130
helper .setRemoveSemicolonContent (false );
131
131
132
- request .setRequestURI ("/foo;a=b;c=d" );
133
- assertEquals ("/foo;a=b;c=d" , helper .getRequestUri (request ));
134
-
135
- request .setRequestURI ("/foo;jsessionid=c0o7fszeb1" );
136
- assertEquals ("/foo" , helper .getRequestUri (request ));
132
+ testKeepSemicolonContent ("/foo;a=b;c=d" , "/foo;a=b;c=d" );
133
+ testKeepSemicolonContent ("/test;jsessionid=1234" , "/test" );
134
+ testKeepSemicolonContent ("/test;JSESSIONID=1234" , "/test" );
135
+ testKeepSemicolonContent ("/test;jsessionid=1234;a=b" , "/test;a=b" );
136
+ testKeepSemicolonContent ("/test;a=b;jsessionid=1234;c=d" , "/test;a=b;c=d" );
137
+ testKeepSemicolonContent ("/test;jsessionid=1234/anotherTest" , "/test/anotherTest" );
138
+ testKeepSemicolonContent ("/test;jsessionid=;a=b" , "/test;a=b" );
139
+ testKeepSemicolonContent ("/somethingLongerThan12;jsessionid=1234" , "/somethingLongerThan12" );
140
+ }
141
+
142
+ private void testKeepSemicolonContent (String requestUri , String expectedPath ) {
143
+ request .setRequestURI (requestUri );
144
+ assertEquals (expectedPath , helper .getRequestUri (request ));
137
145
}
138
146
139
147
@ Test
0 commit comments