Skip to content

Commit

Permalink
Bug 1842468 - Remove dom.xhr.standard_content_type_normalization pref…
Browse files Browse the repository at this point in the history
… r=dom-core,edgar

Differential Revision: https://phabricator.services.mozilla.com/D183798
  • Loading branch information
gregorypappas committed Jul 18, 2023
1 parent 79ebd2d commit cb35f4c
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 28 deletions.
7 changes: 0 additions & 7 deletions dom/base/test/test_bug393968.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({set: [["dom.xhr.standard_content_type_normalization", true]]},
function() {

/** Test for Bug 393968 **/
var req = new XMLHttpRequest();
req.open("POST", window.location.href);
Expand All @@ -31,9 +27,6 @@
.getRequestHeader("Content-Type"),
"text/plain;charset=UTF-8;boundary=01234567890",
"Headers should match");

SimpleTest.finish();
});
</script>
</pre>
</body>
Expand Down
7 changes: 0 additions & 7 deletions dom/base/test/test_bug397234.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({set: [["dom.xhr.standard_content_type_normalization", true]]},
function() {

/** Test for Bug 397234 **/
var req = new XMLHttpRequest();
req.open("POST", window.location.href);
Expand All @@ -32,9 +28,6 @@
.getRequestHeader("Content-Type"),
"text/plain;charset=UTF-8",
"Headers should match");

SimpleTest.finish();
});
</script>
</pre>
</body>
Expand Down
3 changes: 1 addition & 2 deletions dom/xhr/XMLHttpRequestMainThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2943,8 +2943,7 @@ void XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody,
mAuthorRequestHeaders.Get("content-type", uploadContentType);
if (uploadContentType.IsVoid()) {
uploadContentType = defaultContentType;
} else if (aBodyIsDocumentOrString &&
StaticPrefs::dom_xhr_standard_content_type_normalization()) {
} else if (aBodyIsDocumentOrString) {
UniquePtr<CMimeType> contentTypeRecord =
CMimeType::Parse(uploadContentType);
nsAutoCString charset;
Expand Down
7 changes: 2 additions & 5 deletions dom/xhr/tests/test_XHRSendData.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="setupAndRunTests();">
<body onload="executeTests();">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=464848">Mozilla Bug 464848</a>
<p id="display">
Expand All @@ -26,12 +26,9 @@
var gen;
var testDOMFiles;

function setupAndRunTests() {
SpecialPowers.pushPrefEnv({set: [["dom.xhr.standard_content_type_normalization", true]]},
function() {
function executeTests() {
gen = runTests();
createFiles();
});
}

function createFiles() {
Expand Down
6 changes: 0 additions & 6 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4761,12 +4761,6 @@
value: true
mirror: always

# Enable content type normalization of XHR uploads via MIME Sniffing standard
- name: dom.xhr.standard_content_type_normalization
type: RelaxedAtomicBool
value: true
mirror: always

# When this pref is set, parent documents may consider child iframes have
# loaded while they are still loading.
- name: dom.cross_origin_iframes_loaded_in_background
Expand Down
1 change: 0 additions & 1 deletion testing/web-platform/meta/xhr/__dir__.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
prefs: [dom.xhr.standard_content_type_normalization:true]
lsan-allowed: [Alloc, InitializeStaticHeaders, mozilla::net::nsServerSocket::CreateClientTransport]
leak-threshold: [default:51200]

0 comments on commit cb35f4c

Please sign in to comment.