From e31e15c46342192e06f4478ee5b8f22304beb345 Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 18 Dec 2007 23:08:51 +0000 Subject: [PATCH] Fix bug 43241. Patch provided by John Kew. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@605356 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/core/ApplicationContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index d4f0b025d..6bcd9e4d2 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -507,7 +507,7 @@ public class ApplicationContext public InputStream getResourceAsStream(String path) { path = normalize(path); - if (path == null) + if (path == null || !path.startsWith("/")) return (null); DirContext resources = context.getResources(); @@ -865,7 +865,7 @@ public class ApplicationContext String normalized = path; - // Normalize the slashes and add leading slash if necessary + // Normalize the slashes if (normalized.indexOf('\\') >= 0) normalized = normalized.replace('\\', '/'); -- 2.11.0