You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "N. Sean Timm" <st...@mailgo.com> on 2000/07/09 07:58:09 UTC

[PATCH] Don't output double / in URL

Index: FileUtil.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.jav
a,v
retrieving revision 1.9
diff -u -r1.9 FileUtil.java
--- FileUtil.java 2000/06/23 21:49:06 1.9
+++ FileUtil.java 2000/07/09 05:47:57
@@ -120,8 +120,11 @@
      index = path.indexOf("../") + 3;
      path = path.substring(index);
  }
-
- return lookupPath + "/" + path;
+ if(path.startsWith("/")) {
+            return lookupPath + path;
+        } else {
+     return lookupPath + "/" + path;
+        }
     }

     /** All the safety checks from getRealPath() and