Consistent trace logging in PathResourceResolver

Issue: SPR-16616
This commit is contained in:
Juergen Hoeller
2018-03-29 16:04:33 +02:00
parent 53d01392d7
commit 695bf2961f
2 changed files with 10 additions and 10 deletions

View File

@@ -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;
}