]> source.dussan.org Git - vaadin-framework.git/commitdiff
#5488 Avoid encoding slashes and back slashes in ApplicationResource URLs
authorArtur Signell <artur.signell@itmill.com>
Fri, 7 Oct 2011 12:54:05 +0000 (12:54 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 7 Oct 2011 12:54:05 +0000 (12:54 +0000)
svn changeset:21646/svn branch:6.7

src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java

index f619c1c2393cc9eb7eea4014b57c9e1d426ef3a7..26f23d6abc5549b600377c4e320ff2d9be6bd4b4 100644 (file)
@@ -175,7 +175,13 @@ public abstract class AbstractWebApplicationContext implements
         if (filename == null) {
             return "app://APP/" + mapKey + "/";
         } else {
-            return "app://APP/" + mapKey + "/" + urlEncode(filename);
+            // #5488 At least Tomcat and JBoss refuses requests containing
+            // encoded slashes or backslashes in URLs. Application resource URLs
+            // should really be passed in another way than as part of the path
+            // in the future.
+            String encodedFileName = urlEncode(filename).replace("%2F", "/")
+                    .replace("%5C", "\\");
+            return "app://APP/" + mapKey + "/" + encodedFileName;
         }
 
     }