Fix bug 43241. Patch provided by John Kew.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 18 Dec 2007 23:08:51 +0000 (23:08 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 18 Dec 2007 23:08:51 +0000 (23:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@605356 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/ApplicationContext.java

index d4f0b02..6bcd9e4 100644 (file)
@@ -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('\\', '/');