From 5818ed421fc5a3429a26e99ffc93ed4e2fa31d60 Mon Sep 17 00:00:00 2001 From: Sean Feng Date: Mon, 27 May 2024 13:43:07 -0400 Subject: [PATCH] Update the ORB spec to align with Firefox's implementation --- fetch.bs | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index 013a4fc3c..d0be5272c 100644 --- a/fetch.bs +++ b/fetch.bs @@ -3333,8 +3333,7 @@ and a response response, is to run these steps:
  • If response's status is 206 and mimeType is an opaque-response-blocklisted MIME type, then return false. -

  • If nosniff is true and mimeType is an - opaque-response-blocklisted MIME type or its essence is +

  • If nosniff is true and mimeType's essence is "text/plain", then return false. @@ -3466,6 +3465,7 @@ run these steps:


    +

    To obtain a copy of the first 1024 bytes of response, given a response response, run these steps: @@ -3527,9 +3527,11 @@ run these steps:

  • Return first1024Bytes. +
    +

    To determine if response is JavaScript and not JSON given a response response, run these steps:

    @@ -3585,6 +3587,7 @@ run these steps:

  • Return false. +

    New MIME type sets

    @@ -3603,12 +3606,14 @@ run these steps:

    whose essence is one of: @@ -5643,9 +5654,15 @@ these steps: HTTP-network-or-cache fetch given fetchParams.
  • 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. + response's status is not a redirect status, then + +

      +
    1. If request's initiator type is "fetch", + then set internalResponse's body to null. + +

    2. Otherwise, if opaque-response-safelist check given request and response returns + false, then return a network error. +

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