Skip to content

Commit 628261d

Browse files
committed
Do not warn against Root Servlet context location
Closes gh-36692
1 parent 715d33f commit 628261d

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceHandlerUtils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ else if (location instanceof ClassPathResource classPathResource) {
7676
}
7777
else if (location instanceof ContextResource contextResource) {
7878
path = contextResource.getPathWithinContext();
79-
if ("/".equals(path)) {
80-
logger.warn("Resource location '" + location + "' is considered unsafe " +
81-
"and should not be used as it provides access to the root servlet context.");
82-
}
8379
}
8480
else if (location instanceof UrlResource) {
8581
path = location.getURL().toExternalForm();

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ else if (location instanceof ClassPathResource classPathResource) {
7777
}
7878
else if (location instanceof ContextResource contextResource) {
7979
path = contextResource.getPathWithinContext();
80-
if ("/".equals(path)) {
81-
logger.warn("Resource location '" + location + "' is considered unsafe " +
82-
"and should not be used as it provides access to the root servlet context.");
83-
}
8480
}
8581
else if (location instanceof UrlResource) {
8682
path = location.getURL().toExternalForm();

0 commit comments

Comments
 (0)