tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "N. Sean Timm" <st...@mailgo.com>
Subject [PATCH] Don't output double / in URL
Date Sun, 09 Jul 2000 05:58:09 GMT
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



Mime
View raw message