Do not warn against Root Servlet context location

Closes gh-36692
This commit is contained in:
Brian Clozel
2026-05-05 11:11:13 +02:00
parent 715d33f001
commit 628261d5bb
2 changed files with 0 additions and 8 deletions
@@ -76,10 +76,6 @@ public abstract class ResourceHandlerUtils {
}
else if (location instanceof ContextResource contextResource) {
path = contextResource.getPathWithinContext();
if ("/".equals(path)) {
logger.warn("Resource location '" + location + "' is considered unsafe " +
"and should not be used as it provides access to the root servlet context.");
}
}
else if (location instanceof UrlResource) {
path = location.getURL().toExternalForm();
@@ -77,10 +77,6 @@ public abstract class ResourceHandlerUtils {
}
else if (location instanceof ContextResource contextResource) {
path = contextResource.getPathWithinContext();
if ("/".equals(path)) {
logger.warn("Resource location '" + location + "' is considered unsafe " +
"and should not be used as it provides access to the root servlet context.");
}
}
else if (location instanceof UrlResource) {
path = location.getURL().toExternalForm();