Restore JDK 5 compatiblity

This commit is contained in:
Stephane Nicoll
2014-12-30 15:31:13 +01:00
parent 75a9c45865
commit 4bcf92f176

View File

@@ -315,7 +315,8 @@ public class ResourceHttpRequestHandler extends WebContentGenerator implements H
resourcePath = resource.getURL().getPath();
locationPath = location.getURL().getPath();
}
locationPath = (locationPath.endsWith("/") || locationPath.isEmpty() ? locationPath : locationPath + "/");
locationPath = (locationPath.endsWith("/") ||
!StringUtils.hasText(locationPath) ? locationPath : locationPath + "/");
if (!resourcePath.startsWith(locationPath)) {
return false;
}