Consistent trace logging in PathResourceResolver
Issue: SPR-16616
This commit is contained in:
@@ -189,10 +189,10 @@ public class PathResourceResolver extends AbstractResourceResolver {
|
||||
}
|
||||
else if (logger.isTraceEnabled()) {
|
||||
Resource[] allowedLocations = getAllowedLocations();
|
||||
logger.trace("Resource path=\"" + resourcePath + "\" was successfully resolved " +
|
||||
"but resource=\"" + resource.getURL() + "\" is neither under the " +
|
||||
"current location=\"" + location.getURL() + "\" nor under any of the " +
|
||||
"allowed locations=" + (allowedLocations != null ? Arrays.asList(allowedLocations) : "[]"));
|
||||
logger.trace("Resource path \"" + resourcePath + "\" was successfully resolved " +
|
||||
"but resource \"" + resource.getURL() + "\" is neither under the " +
|
||||
"current location \"" + location.getURL() + "\" nor under any of the " +
|
||||
"allowed locations " + (allowedLocations != null ? Arrays.asList(allowedLocations) : "[]"));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -286,7 +286,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
|
||||
String decodedPath = URLDecoder.decode(resourcePath, "UTF-8");
|
||||
if (decodedPath.contains("../") || decodedPath.contains("..\\")) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Ignoring invalid resource path with escape sequences [" + resourcePath + "]");
|
||||
logger.trace("Resolved resource path contains encoded \"../\" or \"..\\\": " + resourcePath);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user