Skip to content

Commit 5e3c86a

Browse files
committed
Merge branch '2.1.x'
Closes gh-17122
2 parents 5375681 + 4222c5b commit 5e3c86a

File tree

1 file changed

+3
-1
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow

1 file changed

+3
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/JarResourceManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import io.undertow.server.handlers.resource.ResourceManager;
2727
import io.undertow.server.handlers.resource.URLResource;
2828

29+
import org.springframework.util.StringUtils;
30+
2931
/**
3032
* {@link ResourceManager} for JAR resources.
3133
*
@@ -48,7 +50,7 @@ class JarResourceManager implements ResourceManager {
4850
public Resource getResource(String path) throws IOException {
4951
URL url = new URL("jar:file:" + this.jarPath + "!" + (path.startsWith("/") ? path : "/" + path));
5052
URLResource resource = new URLResource(url, path);
51-
if (resource.getContentLength() < 0) {
53+
if (StringUtils.hasText(path) && !"/".equals(path) && resource.getContentLength() < 0) {
5254
return null;
5355
}
5456
return resource;

0 commit comments

Comments
 (0)