Bug 819103 - Twitter fails to install from Marketplace. r=sicking, a=blocking-basecamp
authorFabrice Desré <fabrice@mozilla.com>
Fri, 07 Dec 2012 11:20:15 -0800
changeset 117457 91ede36a2a59b043fbaaa1ec049856da447e8d1a
parent 117456 a09ffd0fa42f9b6c62ae078e934281e67bcfbc29
child 117458 4b84a1a1e534276bf6ddfc424e626f689a0d0cb1
push id1893
push userryanvm@gmail.com
push dateMon, 10 Dec 2012 18:14:28 +0000
treeherdermozilla-beta@f786ed0aea2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, blocking-basecamp
bugs819103
milestone18.0
Bug 819103 - Twitter fails to install from Marketplace. r=sicking, a=blocking-basecamp
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.