Browse Source

Restore removal of trailing semicolon content

See gh-26012
pull/26044/head
Juergen Hoeller 4 years ago
parent
commit
990a9c74b9
  1. 7
      spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java

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

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

Loading…
Cancel
Save