From: markt Date: Tue, 18 Dec 2007 23:08:51 +0000 (+0000) Subject: Fix bug 43241. Patch provided by John Kew. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e31e15c46342192e06f4478ee5b8f22304beb345;p=tomcat7.0 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 --- 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('\\', '/');