Bug 1453301 - Stop supporting about:blank in fetch to match the spec. r=baku
authorThomas Wisniewski <wisniewskit@gmail.com>
Fri, 03 Aug 2018 21:52:36 -0400
changeset 430237 502ee99b2c238771850610841fe0ca06916b1d6d
parent 430236 1510b4502e368b76b80dc7379f19307626be1c3e
child 430238 ac280d2e0cbeb2066f1428a809546a075f11bf43
push id34394
push useraciure@mozilla.com
push dateMon, 06 Aug 2018 21:57:24 +0000
treeherdermozilla-central@770a323b3609 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1453301
milestone63.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 1453301 - Stop supporting about:blank in fetch to match the spec. r=baku MozReview-Commit-ID: DMku5SAunfo
dom/fetch/FetchDriver.cpp
dom/tests/mochitest/fetch/test_fetch_basic.js
testing/web-platform/meta/fetch/api/basic/scheme-about.any.js.ini
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -472,17 +472,17 @@ FetchDriver::HttpFetch(const nsACString&
   // is true, and unset otherwise."
 
   // Set skip serviceworker flag.
   // While the spec also gates on the client being a ServiceWorker, we can't
   // infer that here. Instead we rely on callers to set the flag correctly.
   const nsLoadFlags bypassFlag = mRequest->SkipServiceWorker() ?
                                  nsIChannel::LOAD_BYPASS_SERVICE_WORKER : 0;
 
-  nsSecurityFlags secFlags = nsILoadInfo::SEC_ABOUT_BLANK_INHERITS;
+  nsSecurityFlags secFlags = 0;
   if (mRequest->Mode() == RequestMode::Cors) {
     secFlags |= nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS;
   } else if (mRequest->Mode() == RequestMode::Same_origin ||
              mRequest->Mode() == RequestMode::Navigate) {
     secFlags |= nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS;
   } else if (mRequest->Mode() == RequestMode::No_cors) {
     secFlags |= nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;
   } else {
--- a/dom/tests/mochitest/fetch/test_fetch_basic.js
+++ b/dom/tests/mochitest/fetch/test_fetch_basic.js
@@ -1,18 +1,13 @@
 function testAboutURL() {
   var p1 = fetch('about:blank').then(function(res) {
-    is(res.status, 200, "about:blank should load a valid Response");
-    is(res.headers.get('content-type'), 'text/html;charset=utf-8',
-       "about:blank content-type should be text/html;charset=utf-8");
-    is(res.headers.has('content-length'), false,
-       "about:blank should not have a content-length header");
-    return res.text().then(function(v) {
-      is(v, "", "about:blank body should be empty");
-    });
+    ok(false, "about:blank should fail");
+  }, function(e) {
+    ok(e instanceof TypeError, "about:blank should fail");
   });
 
   var p2 = fetch('about:config').then(function(res) {
     ok(false, "about:config should fail");
   }, function(e) {
     ok(e instanceof TypeError, "about:config should fail");
   });
 
deleted file mode 100644
--- a/testing/web-platform/meta/fetch/api/basic/scheme-about.any.js.ini
+++ /dev/null
@@ -1,21 +0,0 @@
-[scheme-about.any.worker.html]
-  [Fetching about:blank with method GET is KO]
-    expected: FAIL
-
-  [Fetching about:blank with method PUT is KO]
-    expected: FAIL
-
-  [Fetching about:blank with method POST is KO]
-    expected: FAIL
-
-
-[scheme-about.any.html]
-  [Fetching about:blank with method GET is KO]
-    expected: FAIL
-
-  [Fetching about:blank with method PUT is KO]
-    expected: FAIL
-
-  [Fetching about:blank with method POST is KO]
-    expected: FAIL
-