From 9004f4e57c1e8db1f91d4d7bcabc29c46470e1cd Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 25 Nov 2022 09:29:50 +0100 Subject: [PATCH] Remove Authorization header upon cross-origin redirect Tests: https://github.com/web-platform-tests/wpt/pull/37145. Fixes #944. --- fetch.bs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index dbf17712a..6312340f0 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4974,11 +4974,10 @@ run these steps:
  • If locationURL's scheme is not an HTTP(S) scheme, then return a network error. -

  • If request's redirect count is - twenty, return a network error. +

  • If request's redirect count is 20, then return a + network error. -

  • Increase request's - redirect count by one. +

  • Increase request's redirect count by 1.

  • If request's mode is "cors", locationURL includes credentials, and request's @@ -5016,6 +5015,16 @@ run these steps: header list. +

  • +

    If request's current URL's origin is not + same origin with locationURL's origin, then + for each headerName of CORS non-wildcard request-header name, + delete headerName from request's + header list. + +

    I.e., the moment another origin is seen after the initial request, the + `Authorization` header is removed. +

  • If request's body is non-null, then set request's body to the body of the result of