From 8ff48984f699a345758e189242eb64a609374a58 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 10 Feb 2021 00:41:59 +0000 Subject: [PATCH] Bug 1687453 [wpt PR 27240] - Fetch: ensure preflight is required for Authorization/Range, a=testonly Automatic update from web-platform-tests Fetch: ensure preflight is required for Authorization/Range Plus some minor cleanup. We will likely have to treat Range as a special case for media elements (see https://github.com/whatwg/fetch/issues/145) so creating this to ensure that only happens when Range is set by the user agent. -- wpt-commits: 56116583e8a403e4b9d410c1429a83fbb96397f4 wpt-pr: 27240 UltraBlame original commit: fb94e67baa08bbced0bebf19114b1f7c8dc255a6 --- .../cors/resources/not-cors-safelisted.json | 18 ++++++++ .../credentials/authentication-basic.any.js | 46 ++++++++++++------- .../tests/fetch/api/resources/utils.js | 27 ----------- 3 files changed, 48 insertions(+), 43 deletions(-) diff --git a/testing/web-platform/tests/fetch/api/cors/resources/not-cors-safelisted.json b/testing/web-platform/tests/fetch/api/cors/resources/not-cors-safelisted.json index 284e8ca4a4a59..ef975e8cb7a81 100644 --- a/testing/web-platform/tests/fetch/api/cors/resources/not-cors-safelisted.json +++ b/testing/web-platform/tests/fetch/api/cors/resources/not-cors-safelisted.json @@ -38,6 +38,14 @@ language ] [ " +authorization +" +" +basics +" +] +[ +" content - language @@ -86,6 +94,16 @@ long ] [ " +range +" +" +bytes +0 +- +" +] +[ +" test " " diff --git a/testing/web-platform/tests/fetch/api/credentials/authentication-basic.any.js b/testing/web-platform/tests/fetch/api/credentials/authentication-basic.any.js index 50c4b9ed8460a..829e4e5f039ff 100644 --- a/testing/web-platform/tests/fetch/api/credentials/authentication-basic.any.js +++ b/testing/web-platform/tests/fetch/api/credentials/authentication-basic.any.js @@ -6,20 +6,6 @@ global = window worker -/ -/ -META -: -script -= -. -. -/ -resources -/ -utils -. -js function basicAuth ( @@ -80,9 +66,12 @@ headers return fetch ( -RESOURCES_DIR -+ " +. +. +/ +resources +/ authentication . py @@ -218,3 +207,28 @@ omit 200 ) ; +basicAuth +( +" +User +- +added +bogus +Authorization +header +with +omit +mode +" +" +notuser +" +" +notpassword +" +" +omit +" +401 +) +; diff --git a/testing/web-platform/tests/fetch/api/resources/utils.js b/testing/web-platform/tests/fetch/api/resources/utils.js index bca54654b15cf..96cbbd21bc6cc 100644 --- a/testing/web-platform/tests/fetch/api/resources/utils.js +++ b/testing/web-platform/tests/fetch/api/resources/utils.js @@ -1,9 +1,4 @@ var -inWorker -= -false -; -var RESOURCES_DIR = " @@ -14,28 +9,6 @@ resources / " ; -try -{ -inWorker -= -! -( -self -instanceof -Window -) -; -} -catch -( -e -) -{ -inWorker -= -true -; -} function dirname (