Bug 819103 - Twitter fails to install from Marketplace [r=sicking]
authorFabrice Desré <fabrice@mozilla.com>
Fri, 07 Dec 2012 11:20:15 -0800
changeset 115347 76fdff965077ceea18b2c999ae838e9c0318dafa
parent 115346 9bf579519470788827cd2d1b2000c85f92bdece3
child 115348 01654665475b32a75335d5092ce06830a45460e0
push id19297
push userfdesre@mozilla.com
push dateFri, 07 Dec 2012 19:20:29 +0000
treeherdermozilla-inbound@76fdff965077 [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.