Restore removal of trailing semicolon content

See gh-26012
This commit is contained in:
Juergen Hoeller 2020-11-04 23:42:28 +01:00
parent b815accca9
commit 990a9c74b9
1 changed files with 4 additions and 3 deletions

View File

@ -618,10 +618,11 @@ public class UrlPathHelper {
} }
StringBuilder sb = new StringBuilder(requestUri); StringBuilder sb = new StringBuilder(requestUri);
while (semicolonIndex != -1) { while (semicolonIndex != -1) {
int slashIndex = requestUri.indexOf('/', semicolonIndex); int slashIndex = requestUri.indexOf('/', semicolonIndex + 1);
if (slashIndex >= 0) { if (slashIndex == -1) {
sb.delete(semicolonIndex, slashIndex); slashIndex = sb.length();
} }
sb.delete(semicolonIndex, slashIndex);
semicolonIndex = sb.indexOf(";", semicolonIndex); semicolonIndex = sb.indexOf(";", semicolonIndex);
} }
return sb.toString(); return sb.toString();