Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=38570
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Feb 2009 19:05:44 +0000 (19:05 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Feb 2009 19:05:44 +0000 (19:05 +0000)
When checking docBase against appBase, make sure we check for an exact match against the appBase

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@742677 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/ContextConfig.java

index 6fa6dff..1fe43c6 100644 (file)
@@ -908,7 +908,7 @@ public class ContextConfig
             }
         }
 
-        if (docBase.startsWith(canonicalAppBase.getPath())) {
+        if (docBase.startsWith(canonicalAppBase.getPath() + File.separatorChar)) {
             docBase = docBase.substring(canonicalAppBase.getPath().length());
             docBase = docBase.replace(File.separatorChar, '/');
             if (docBase.startsWith("/")) {