Merge branch '5.2.x'
This commit is contained in:
@@ -49,7 +49,7 @@ class DefaultRequestPath implements RequestPath {
|
||||
}
|
||||
|
||||
private static PathContainer initContextPath(PathContainer path, @Nullable String contextPath) {
|
||||
if (!StringUtils.hasText(contextPath) || "/".equals(contextPath)) {
|
||||
if (!StringUtils.hasText(contextPath) || StringUtils.matchesCharacter(contextPath, '/')) {
|
||||
return PathContainer.parsePath("");
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class DefaultRequestPath implements RequestPath {
|
||||
int length = contextPath.length();
|
||||
int counter = 0;
|
||||
|
||||
for (int i=0; i < path.elements().size(); i++) {
|
||||
for (int i = 0; i < path.elements().size(); i++) {
|
||||
PathContainer.Element element = path.elements().get(i);
|
||||
counter += element.value().length();
|
||||
if (length == counter) {
|
||||
|
||||
@@ -233,7 +233,7 @@ public class UrlPathHelper {
|
||||
}
|
||||
// Else, use path within current servlet mapping if applicable
|
||||
String rest = getPathWithinServletMapping(request);
|
||||
if (!"".equals(rest)) {
|
||||
if (StringUtils.hasLength(rest)) {
|
||||
return rest;
|
||||
}
|
||||
else {
|
||||
@@ -415,7 +415,7 @@ public class UrlPathHelper {
|
||||
if (contextPath == null) {
|
||||
contextPath = request.getContextPath();
|
||||
}
|
||||
if ("/".equals(contextPath)) {
|
||||
if (StringUtils.matchesCharacter(contextPath, '/')) {
|
||||
// Invalid case, but happens for includes on Jetty: silently adapt it.
|
||||
contextPath = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user