Skip to content

Commit 990a9c7

Browse files
committed
Restore removal of trailing semicolon content
See gh-26012
1 parent b815acc commit 990a9c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,11 @@ private static String removeSemicolonContentInternal(String requestUri) {
618618
}
619619
StringBuilder sb = new StringBuilder(requestUri);
620620
while (semicolonIndex != -1) {
621-
int slashIndex = requestUri.indexOf('/', semicolonIndex);
622-
if (slashIndex >= 0) {
623-
sb.delete(semicolonIndex, slashIndex);
621+
int slashIndex = requestUri.indexOf('/', semicolonIndex + 1);
622+
if (slashIndex == -1) {
623+
slashIndex = sb.length();
624624
}
625+
sb.delete(semicolonIndex, slashIndex);
625626
semicolonIndex = sb.indexOf(";", semicolonIndex);
626627
}
627628
return sb.toString();

0 commit comments

Comments
 (0)