Improve efficiency of UrlPathHelper#getSanitizedPath

See gh-27623
This commit is contained in:
happyWilliam0
2021-11-09 09:47:02 +00:00
committed by Rossen Stoyanchev
parent c5de5c9939
commit b5743966d6
2 changed files with 17 additions and 10 deletions
@@ -246,6 +246,12 @@ class UrlPathHelperTests {
request.setRequestURI("/SPR-12372/foo/bar//");
assertThat(helper.getLookupPathForRequest(request)).isEqualTo("/foo/bar//");
// "enhance" case
request.setServletPath("/foo/bar//");
request.setRequestURI("/SPR-12372////////////////////////foo//////////////////bar////////////////////");
assertThat(helper.getLookupPathForRequest(request)).isEqualTo("/foo/bar//");
}
@Test