Bug 773884 - Remove special "index.html" path mapping support for app:// scheme [r=bsmith]
authorAntonio Manuel Amaya Calvo <amac@tid.es>
Wed, 29 Aug 2012 05:29:18 -0700
changeset 105800 2f69a9df19a3bef53d24b54ea9b0ef8b9674b058
parent 105799 b0a07b59d5d250c507b1c34e7101b6ed65e39f66
child 105801 338e6a97f0de919ea0e59c0e91689c8c49bed4d6
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersbsmith
bugs773884
milestone18.0a1
Bug 773884 - Remove special "index.html" path mapping support for app:// scheme [r=bsmith]
netwerk/protocol/app/AppProtocolHandler.js
--- a/netwerk/protocol/app/AppProtocolHandler.js
+++ b/netwerk/protocol/app/AppProtocolHandler.js
@@ -54,26 +54,16 @@ AppProtocolHandler.prototype = {
 
     let appId = noScheme;
     let fileSpec = aURI.path;
 
     if (firstSlash) {
       appId = noScheme.substring(0, firstSlash);
     }
 
-    // Simulates default behavior of http servers:
-    // Adds index.html if the file spec ends in / in /#anchor
-    let lastSlash = fileSpec.lastIndexOf("/");
-    if (lastSlash == fileSpec.length - 1) {
-      fileSpec += "index.html";
-    } else if (fileSpec[lastSlash + 1] == '#') {
-      let anchor = fileSpec.substring(lastSlash + 1);
-      fileSpec = fileSpec.substring(0, lastSlash) + "/index.html" + anchor;
-    }
-
     // Build a jar channel and masquerade as an app:// URI.
     let uri = "jar:file://" + this.basePath + appId + "/application.zip!" + fileSpec;
     let channel = Services.io.newChannel(uri, null, null);
     channel.QueryInterface(Ci.nsIJARChannel).setAppURI(aURI);
     channel.QueryInterface(Ci.nsIChannel).originalURI = aURI;
 
     return channel;
   },