Skip to content

Commit 4bcf92f

Browse files
committed
Restore JDK 5 compatiblity
1 parent 75a9c45 commit 4bcf92f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ else if (resource instanceof ServletContextResource) {
315315
resourcePath = resource.getURL().getPath();
316316
locationPath = location.getURL().getPath();
317317
}
318-
locationPath = (locationPath.endsWith("/") || locationPath.isEmpty() ? locationPath : locationPath + "/");
318+
locationPath = (locationPath.endsWith("/") ||
319+
!StringUtils.hasText(locationPath) ? locationPath : locationPath + "/");
319320
if (!resourcePath.startsWith(locationPath)) {
320321
return false;
321322
}

0 commit comments

Comments
 (0)