Improve URI/query strings sanitization
This commit is contained in:
committed by
Juergen Hoeller
parent
b077e4cd85
commit
0015fd6734
@@ -1200,4 +1200,9 @@ class UriComponentsBuilderTests {
|
||||
assertThat(UriComponentsBuilder.fromUriString("/path?q={asa}asa").toUriString()).isEqualTo("/path?q=%7Basa%7Dasa");
|
||||
}
|
||||
|
||||
@Test
|
||||
void verifyDoubleSlashReplacedWithSingleOne() {
|
||||
String path = UriComponentsBuilder.fromPath("/home/").path("/path").build().getPath();
|
||||
assertThat(path).isEqualTo("/home/path");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,9 @@ public class UrlPathHelperTests {
|
||||
|
||||
request.setRequestURI("/foo+bar");
|
||||
assertThat(helper.getRequestUri(request)).isEqualTo("/foo+bar");
|
||||
|
||||
request.setRequestURI("/home/" + "/path");
|
||||
assertThat(helper.getRequestUri(request)).isEqualTo("/home/path");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user