From 287ef66629238a7d63bed59b92a41aa3993b940a Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 31 May 2022 11:08:01 +0200 Subject: [PATCH] Move the opaque-response-safelist check invocation (CORB as specified applied to service worker responses, but that seems wrong.) --- fetch.bs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/fetch.bs b/fetch.bs index ea54f4444..072c278e7 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4366,14 +4366,8 @@ steps:
  • Set request's response tainting to "opaque". -

  • Let opaqueResponse be the result of running scheme fetch given - fetchParams. +

  • Return the result of running scheme fetch given fetchParams. - -

  • If the opaque-response-safelist check given request and - opaqueResponse returns true, then return opaqueResponse. - -

  • Return a network error.

    request's current URL's scheme is not an @@ -4947,19 +4941,23 @@ these steps:
  • Set response and actualResponse to the result of running HTTP-network-or-cache fetch given fetchParams. -

  • -

    If request's response tainting is "cors" and a - CORS check for request and response returns failure, then return a - network error. +

  • If request's response tainting is "opaque", + response's status is not a redirect status, and the + opaque-response-safelist check given request and response returns + false, then return a network error. -

    As the CORS check is not to be applied to - responses whose status is 304 or 407, or responses - from a service worker for that matter, it is applied here. +

  • If request's response tainting is "cors" and + the CORS check for request and response returns failure, then return + a network error.

  • If the TAO check for request and response returns failure, then set request's timing allow failed flag. +

    As the opaque-response-safelist check, CORS check, and + TAO check are not to be applied to responses whose status + is 304 or 407, or to responses from a service worker, they are applied here. +

  • If either request's response tainting or response's type is "opaque", and the