Backed out changeset 5dc08ac77984 (bug 1411725) for causing browser_caching_attributes.js perma failures CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Fri, 22 Mar 2019 10:48:32 +0200
changeset 465586 bd667863595107485ce1f88e4e896a575b1e8e97
parent 465585 63df58e1fae0c4254c2826524bd8184fb161045f
child 465587 2c4f799e65b2fad5790d8edd549bf69ba6248301
push id35744
push userapavel@mozilla.com
push dateFri, 22 Mar 2019 16:44:08 +0000
treeherdermozilla-central@e66a2b59914d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1411725
milestone68.0a1
backs out5dc08ac77984b6ccf679aebada2f59b16acc3d2d
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
Backed out changeset 5dc08ac77984 (bug 1411725) for causing browser_caching_attributes.js perma failures CLOSED TREE
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xhr/tests/browser.ini
dom/xhr/tests/browser_xhr_substituted_protocol_responseURL.js
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -776,17 +776,19 @@ void XMLHttpRequestMainThread::GetRespon
 
   // Make sure we don't leak responseURL information from denied cross-site
   // requests.
   if (IsDeniedCrossSiteCORSRequest()) {
     return;
   }
 
   nsCOMPtr<nsIURI> responseUrl;
-  if (NS_FAILED(NS_GetFinalChannelURI(mChannel, getter_AddRefs(responseUrl)))) {
+  mChannel->GetURI(getter_AddRefs(responseUrl));
+
+  if (!responseUrl) {
     return;
   }
 
   nsAutoCString temp;
   responseUrl->GetSpecIgnoringRef(temp);
   CopyUTF8toUTF16(temp, aUrl);
 }
 
--- a/dom/xhr/tests/browser.ini
+++ b/dom/xhr/tests/browser.ini
@@ -1,8 +1,7 @@
 [DEFAULT]
 support-files =
   browser_xhr_onchange_leak.html
 [browser_blobFromFile.js]
 [browser_xhr_onchange_leak.js]
-[browser_xhr_substituted_protocol_responseURL.js]
 [browser_temporaryFile.js]
 support-files =  temporaryFileBlob.sjs
deleted file mode 100644
--- a/dom/xhr/tests/browser_xhr_substituted_protocol_responseURL.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-// Bug 1411725 - An XHR using a SubstitutingProtocolHandler channel
-// (web-extension:, resource:, etc) should return the original URL,
-// not the jar/file it was actually substituted for.
-
-const TEST_URL = "resource://gre/modules/XPCOMUtils.jsm";
-
-add_task(async function test() {
-  await new Promise(resolve => {
-    const xhr = new XMLHttpRequest();
-    xhr.responseType = "text";
-    xhr.open("get", TEST_URL);
-    xhr.addEventListener("loadend", () => {
-      is(xhr.responseURL, TEST_URL, "original URL is given instead of substitution");
-      resolve();
-    });
-    xhr.send();
-  });
-});