Bug 819103 - Twitter fails to install from Marketplace [r=sicking]
authorFabrice Desré <fabrice@mozilla.com>
Fri, 07 Dec 2012 11:20:15 -0800
changeset 115382 76fdff965077ceea18b2c999ae838e9c0318dafa
parent 115381 9bf579519470788827cd2d1b2000c85f92bdece3
child 115383 01654665475b32a75335d5092ce06830a45460e0
push id24003
push usereakhgari@mozilla.com
push dateSun, 09 Dec 2012 18:17:18 +0000
treeherdermozilla-central@725eb8792d27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs819103
milestone20.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 819103 - Twitter fails to install from Marketplace [r=sicking]
dom/apps/src/AppsUtils.jsm
--- a/dom/apps/src/AppsUtils.jsm
+++ b/dom/apps/src/AppsUtils.jsm
@@ -7,16 +7,21 @@
 const Cu = Components.utils;
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
+XPCOMUtils.defineLazyGetter(this, "NetUtil", function() {
+  return Cc["@mozilla.org/network/util;1"]
+           .getService(Ci.nsINetUtil);
+});
+
 // Shared code for AppsServiceChild.jsm, Webapps.jsm and Webapps.js
 
 this.EXPORTED_SYMBOLS = ["AppsUtils", "ManifestHelper"];
 
 function debug(s) {
   //dump("-*- AppsUtils.jsm: " + s + "\n");
 }
 
@@ -180,18 +185,21 @@ this.AppsUtils = {
         return false;
       }
     }
 
     return true;
   },
 
   checkManifestContentType: function
-     checkManifestContentType(installOrigin, webappOrigin, contentType) {
-    if (installOrigin != webappOrigin &&
+     checkManifestContentType(aInstallOrigin, aWebappOrigin, aContentType) {
+    let hadCharset = { };
+    let charset = { };
+    let contentType = NetUtil.parseContentType(aContentType, charset, hadCharset);
+    if (aInstallOrigin != aWebappOrigin &&
         contentType != "application/x-web-app-manifest+json") {
       return false;
     }
     return true;
   },
 
   /**
    * Determines whether the manifest allows installs for the given origin.