Skip to content

Commit a81325b

Browse files
adavid9wilkinsona
authored andcommitted
Hide loader classes from Tomcat's ServletContext resource paths
See gh-17538
1 parent b725c60 commit a81325b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.List;
3232
import java.util.Locale;
3333
import java.util.Set;
34+
import java.util.stream.Collectors;
3435

3536
import javax.servlet.ServletContainerInitializer;
3637

@@ -88,6 +89,7 @@
8889
* @author Andy Wilkinson
8990
* @author Eddú Meléndez
9091
* @author Christoffer Sawicki
92+
* @author Dawid Antecki
9193
* @since 2.0.0
9294
* @see #setPort(int)
9395
* @see #setContextLifecycleListeners(Collection)
@@ -751,7 +753,8 @@ public String[] list(String path) {
751753

752754
@Override
753755
public Set<String> listWebAppPaths(String path) {
754-
return this.delegate.listWebAppPaths(path);
756+
return this.delegate.listWebAppPaths(path).stream()
757+
.filter((p) -> !p.startsWith("org/springframework/boot/loader")).collect(Collectors.toSet());
755758
}
756759

757760
@Override

0 commit comments

Comments
 (0)