Skip to content

Commit

Permalink
Bug 1504344 - Remove the pref dom.xhr.lowercase_header.enabled; r=baku
Browse files Browse the repository at this point in the history
Remove the pref dom.xhr.lowercase_header.enabled, as we are unaware of any actionable compat concerns now that bug 1540688 landed, and an ESR had been spun off.

Differential Revision: https://phabricator.services.mozilla.com/D39636

--HG--
extra : moz-landing-system : lando
  • Loading branch information
wisniewskit committed Jul 31, 2019
1 parent 18ee326 commit 694c55b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
22 changes: 0 additions & 22 deletions dom/xhr/XMLHttpRequestMainThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2969,20 +2969,6 @@ bool XMLHttpRequestMainThread::IsMappedArrayBufferEnabled() {
return sIsMappedArrayBufferEnabled;
}

/* static */
bool XMLHttpRequestMainThread::IsLowercaseResponseHeader() {
static bool sLowercaseResponseHeaderAdded = false;
static bool sIsLowercaseResponseHeaderEnabled;

if (!sLowercaseResponseHeaderAdded) {
Preferences::AddBoolVarCache(&sIsLowercaseResponseHeaderEnabled,
"dom.xhr.lowercase_header.enabled", false);
sLowercaseResponseHeaderAdded = true;
}

return sIsLowercaseResponseHeaderEnabled;
}

// http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader
void XMLHttpRequestMainThread::SetRequestHeader(const nsACString& aName,
const nsACString& aValue,
Expand Down Expand Up @@ -3572,14 +3558,6 @@ NS_IMPL_ISUPPORTS(XMLHttpRequestMainThread::nsHeaderVisitor,
NS_IMETHODIMP XMLHttpRequestMainThread::nsHeaderVisitor::VisitHeader(
const nsACString& header, const nsACString& value) {
if (mXHR.IsSafeHeader(header, mHttpChannel)) {
if (!IsLowercaseResponseHeader()) {
if (!mHeaderList.InsertElementSorted(HeaderEntry(header, value),
fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
return NS_OK;
}

nsAutoCString lowerHeader(header);
ToLowerCase(lowerHeader);
if (!mHeaderList.InsertElementSorted(HeaderEntry(lowerHeader, value),
Expand Down
7 changes: 0 additions & 7 deletions dom/xhr/XMLHttpRequestMainThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,6 @@ class XMLHttpRequestMainThread final : public XMLHttpRequest,
// supported.
static bool IsMappedArrayBufferEnabled();

// Check pref "dom.xhr.lowercase_header.enabled" to make sure lowercased
// response header is supported.
static bool IsLowercaseResponseHeader();

void MaybeLowerChannelPriority();

public:
Expand Down Expand Up @@ -526,9 +522,6 @@ class XMLHttpRequestMainThread final : public XMLHttpRequest,
}

bool operator<(const HeaderEntry& aOther) const {
if (!IsLowercaseResponseHeader()) {
return mName < aOther.mName;
}
uint32_t selfLen = mName.Length();
uint32_t otherLen = aOther.mName.Length();
uint32_t min = XPCOM_MIN(selfLen, otherLen);
Expand Down
3 changes: 0 additions & 3 deletions modules/libpref/init/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -5453,9 +5453,6 @@ pref("toolkit.telemetry.overrideUpdateChannel", "nightly-asan");
pref("layers.mlgpu.enable-on-windows7", true);
#endif

// Enable lowercased response header name
pref("dom.xhr.lowercase_header.enabled", true);

// Control whether clients.openWindow() opens windows in the same process
// that called the API vs following our normal multi-process selection
// algorithm. Restricting openWindow to same process improves service worker
Expand Down
2 changes: 1 addition & 1 deletion testing/web-platform/meta/xhr/__dir__.ini
Original file line number Diff line number Diff line change
@@ -1 +1 @@
prefs: [dom.xhr.lowercase_header.enabled:true, javascript.options.streams:true, dom.xhr.standard_content_type_normalization:true]
prefs: [javascript.options.streams:true, dom.xhr.standard_content_type_normalization:true]

0 comments on commit 694c55b

Please sign in to comment.