Bug 1499136 - Disable dom.xhr.standard_content_type_normalization for now due to webcompat issues; r=hsivonen
authorThomas Wisniewski <twisniewski@mozilla.com>
Thu, 18 Oct 2018 02:10:25 +0000
changeset 490217 0bb500ba0c07c122610452184a162166ff47ce96
parent 490216 8d820a4fe6e63e80cb05e5c27351b7a3fdf57577
child 490218 638dee1dfab113b0c2333fb62509180cf21c2124
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewershsivonen
bugs1499136
milestone64.0a1
Bug 1499136 - Disable dom.xhr.standard_content_type_normalization for now due to webcompat issues; r=hsivonen Disable dom.xhr.standard_content_type_normalization for now due to webcompat issues Differential Revision: https://phabricator.services.mozilla.com/D8789
dom/xhr/tests/test_XHRSendData.html
modules/libpref/init/StaticPrefList.h
--- a/dom/xhr/tests/test_XHRSendData.html
+++ b/dom/xhr/tests/test_XHRSendData.html
@@ -3,17 +3,17 @@
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=464848
 -->
 <head>
   <title>XMLHttpRequest send data and headers</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
-<body onload="createFiles();">
+<body onload="setupAndRunTests();">
 <a target="_blank"
    href="https://bugzilla.mozilla.org/show_bug.cgi?id=464848">Mozilla Bug 464848</a>
 <p id="display">
 </p>
 <div id="content" style="display: none">
 
 </div>
 <pre id="test">
@@ -21,16 +21,24 @@ https://bugzilla.mozilla.org/show_bug.cg
 SimpleTest.waitForExplicitFinish();
 
 var testData = "blahblahblahblahblahblahblaaaaaaaah. blah.";
 var extensions = [".txt",".png",".jpg",".gif",".xml", "noext"];
 var fileTypes = ["text/plain", "image/png", "image/jpeg", "image/gif", "text/xml", null];
 var gen;
 var testDOMFiles;
 
+function setupAndRunTests() {
+  SpecialPowers.pushPrefEnv({set: [["dom.xhr.standard_content_type_normalization", true]]},
+  function() {
+    gen = runTests();
+    createFiles();
+  });
+}
+
 function createFiles() {
   var filesToCreate = new Array();
   extensions.forEach(function (extension) {
     filesToCreate.push({name: "testfile" + extension, data: testData});
   });
   SpecialPowers.createFiles(filesToCreate,
                             function (files) {
                               testDOMFiles = files;
@@ -254,17 +262,12 @@ function is_identical_arraybuffer(ab1, a
   u8v1 = new Uint8Array(ab1);
   u8v2 = new Uint8Array(ab2);
   is(String.fromCharCode.apply(String, u8v1),
      String.fromCharCode.apply(String, u8v2), "arraybuffer values not equal");
 }
 
 SimpleTest.finish();
 } /* runTests */
-
-SpecialPowers.pushPrefEnv({set: [["dom.xhr.standard_content_type_normalization", true]]},
-function() {
-  gen = runTests();
-});
 </script>
 </pre>
 </body>
 </html>
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -418,20 +418,21 @@ VARCACHE_PREF(
 
 VARCACHE_PREF(
   "dom.worker.canceling.timeoutMilliseconds",
    dom_worker_canceling_timeoutMilliseconds,
   RelaxedAtomicUint32, 30000 /* 30 seconds */
 )
 
 // Enable content type normalization of XHR uploads via MIME Sniffing standard
+// Disabled for now in bz1499136
 VARCACHE_PREF(
   "dom.xhr.standard_content_type_normalization",
    dom_xhr_standard_content_type_normalization,
-  RelaxedAtomicBool, true
+  RelaxedAtomicBool, false
 )
 
 //---------------------------------------------------------------------------
 // Clear-Site-Data prefs
 //---------------------------------------------------------------------------
 
 VARCACHE_PREF(
   "dom.clearSiteData.enabled",