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 103766 2f69a9df19a3bef53d24b54ea9b0ef8b9674b058
parent 103765 b0a07b59d5d250c507b1c34e7101b6ed65e39f66
child 103767 338e6a97f0de919ea0e59c0e91689c8c49bed4d6
push id23376
push userryanvm@gmail.com
push dateThu, 30 Aug 2012 00:15:25 +0000
treeherdermozilla-central@706174d31a02 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmith
bugs773884
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;
   },