This commit is contained in:
Rossen Stoyanchev
2018-11-26 16:00:47 -05:00
parent 959cf61647
commit 3eee118b44
2 changed files with 38 additions and 73 deletions

View File

@@ -126,17 +126,16 @@ public class ResourceUrlEncodingFilter extends GenericFilterBean {
return null;
}
private int getEndPathIndex(String lookupPath) {
int suffixIndex = lookupPath.length();
int queryIndex = lookupPath.indexOf('?');
if (queryIndex > 0) {
suffixIndex = queryIndex;
private int getEndPathIndex(String path) {
int end = path.indexOf('?');
int fragmentIndex = path.indexOf('#');
if (fragmentIndex != -1 && (end == -1 || fragmentIndex < end)) {
end = fragmentIndex;
}
int hashIndex = lookupPath.indexOf('#');
if (hashIndex > 0) {
suffixIndex = Math.min(suffixIndex, hashIndex);
if (end == -1) {
end = path.length();
}
return suffixIndex;
return end;
}
}