Polish file locations in resource handling

Issue: SPR-12747
This commit is contained in:
Brian Clozel
2015-02-26 17:16:44 +01:00
parent 2beca4d75e
commit cbe4a49b54

View File

@@ -179,8 +179,10 @@ public class PathResourceResolver extends AbstractResourceResolver {
resourcePath = resource.getURL().getPath();
locationPath = StringUtils.cleanPath(location.getURL().getPath());
}
locationPath = (StringUtils.getFilenameExtension(locationPath) != null
|| locationPath.endsWith("/") || locationPath.isEmpty() ? locationPath : locationPath + "/");
if(locationPath.equals(resourcePath)) {
return true;
}
locationPath = (locationPath.endsWith("/") || locationPath.isEmpty() ? locationPath : locationPath + "/");
if (!resourcePath.startsWith(locationPath)) {
return false;
}