diff --git a/fetch.bs b/fetch.bs index bf9966c62..9057e3894 100644 --- a/fetch.bs +++ b/fetch.bs @@ -94,12 +94,6 @@ url:https://tools.ietf.org/html/draft-ietf-httpbis-header-structure#section-4.2; } - - -

Goals

@@ -988,14 +982,11 @@ user-agent-defined value for the

A status is a code. -

A null body status is a status that is 101, -204, 205, or 304. +

A null body status is a status that is 101, 204, 205, or 304. -

An ok status is any status in the range 200 to -299, inclusive. +

An ok status is any status in the range 200 to 299, inclusive. -

A redirect status is a status that is 301, -302, 303, 307, or 308. +

A redirect status is a status that is 301, 302, 303, 307, or 308.

Bodies

@@ -1828,8 +1819,8 @@ more response URLs). Unless stated otherwise, it is the empty list. atomic HTTP redirect handling.

A response has an associated -status, which is a -status. Unless stated otherwise it is 200. +status, which is a status. +Unless stated otherwise it is 200.

A response has an associated status message. Unless stated @@ -1912,9 +1903,8 @@ known as an aborted network errortype is "error" is known as a network error. -

A network error is a -response whose -status is always 0, +

A network error is a response whose +status is always 0, status message is always the empty byte sequence, header list is always empty, and body is always null. @@ -1960,7 +1950,7 @@ which is only "accessible" to internal specification algorithms and is never a filtered response whose type is "opaque", URL list is the empty list, -status is 0, +status is 0, status message is the empty byte sequence, header list is empty, and body is null. @@ -1969,7 +1959,7 @@ which is only "accessible" to internal specification algorithms and is never a opaque-redirect filtered response is a filtered response whose type is "opaqueredirect", -status is 0, +status is 0, status message is the empty byte sequence, header list is empty, and body is null. @@ -2456,7 +2446,7 @@ from a {{ReadableStream}} object with reader, run these steps:

error steps, given e
    -
  1. Reject promise with e. +

  2. Reject promise with e.

@@ -2718,8 +2708,8 @@ if the CORS protocol is understood. It uses `OPTIONS` as

In case a server does not wish to participate in the CORS protocol, its HTTP response to the CORS or CORS-preflight request must not include any of the above -headers. The server is encouraged to use the 403 status in -such HTTP responses. +headers. The server is encouraged to use the 403 status in such HTTP +responses.

HTTP new-header syntax

@@ -3186,8 +3176,8 @@ run these steps:

  • If mimeType is failure, then return allowed. -

  • If response's status is 206 and - mimeType is a CORB-protected MIME type, then return blocked. +

  • If response's status is 206 and mimeType is a + CORB-protected MIME type, then return blocked.

  • If determine nosniff with response's header list is true @@ -3196,8 +3186,8 @@ run these steps:

    CORB only protects text/plain responses with a `X-Content-Type-Options: nosniff` header. Unfortunately, protecting such responses - without that header when their status is 206 would break too many - existing video responses that have a text/plain MIME type. + without that header when their status is 206 would break too many existing + video responses that have a text/plain MIME type. @@ -3785,11 +3775,10 @@ optionally with a recursive flag, run these steps:

  • If response's type is "opaque", - internalResponse's status is 206, - internalResponse's range-requested flag is set, and - request's header list does not contain - `Range`, then set response and internalResponse to a - network error. + internalResponse's status is 206, internalResponse's + range-requested flag is set, and request's + header list does not contain `Range`, + then set response and internalResponse to a network error.

    Traditionally, APIs accept a ranged response even if a range was not requested. This prevents @@ -4122,8 +4111,8 @@ optional CORS-preflight flag, run these steps: 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. + responses whose status is 304 or 407, or responses + from a service worker for that matter, it is applied here.

  • If the TAO check for request and response returns failure, then set request's timing allow failed flag. @@ -4146,11 +4135,11 @@ optional CORS-preflight flag, run these steps:

    1. -

      If actualResponse's status is not 303, - request's body is not null, and the connection uses HTTP/2, - then user agents may, and are even encouraged to, transmit an RST_STREAM frame. +

      If actualResponse's status is not 303, request's + body is not null, and the connection uses HTTP/2, then user agents + may, and are even encouraged to, transmit an RST_STREAM frame. -

      303 is excluded as certain communities ascribe special status to it. +

      303 is excluded as certain communities ascribe special status to it.

    2. Let location be the result of extracting header list values given `Location` and actualResponse's header list. @@ -4234,9 +4223,9 @@ optional CORS-preflight flag, run these steps:

      This catches a cross-origin resource redirecting to a same-origin URL. -

    3. If actualResponse's status is not 303, - request's body is non-null, and request's - body's source is null, then return a network error. +

    4. If actualResponse's status is not 303, request's + body is non-null, and request's body's + source is null, then return a network error.

    5. If actualResponse's location URL's origin is not same origin with request's current URL's @@ -4248,10 +4237,10 @@ optional CORS-preflight flag, run these steps:

      If one of the following is true

        -
      • actualResponse's status is 301 or - 302 and request's method is `POST` -

      • actualResponse's status is 303 and - request's method is not `GET` or `HEAD` +

      • actualResponse's status is 301 or 302 and + request's method is `POST` +

      • actualResponse's status is 303 and request's + method is not `GET` or `HEAD`

      then: @@ -4663,14 +4652,14 @@ Range Requests. [[HTTP-RANGE]] However, this is not widely supported by b

    6. If httpRequest's method is unsafe and - forwardResponse's status is in the range 200 to - 399, inclusive, invalidate appropriate stored responses in httpCache, as - per the "Invalidation" chapter of + forwardResponse's status is in the range 200 to 399, inclusive, + invalidate appropriate stored responses in httpCache, as per the + "Invalidation" chapter of HTTP Caching, and set storedResponse to null. [[!HTTP-CACHING]]

    7. If the revalidatingFlag is set and forwardResponse's - status is 304, then: + status is 304, then:

      1. @@ -4708,10 +4697,10 @@ Range Requests. [[HTTP-RANGE]] However, this is not widely supported by b `Range`, then set response's range-requested flag.
      2. -

        If response's status is 401, - httpRequest's response tainting is not "cors", the - credentials flag is set, and request's window is an - environment settings object, then: +

        If response's status is 401, httpRequest's + response tainting is not "cors", the credentials flag is + set, and request's window is an environment settings object, + then:

        1. Needs testing: multiple `WWW-Authenticate` headers, missing, @@ -4762,7 +4751,7 @@ Range Requests. [[HTTP-RANGE]] However, this is not widely supported by b

      3. -

        If response's status is 407, then: +

        If response's status is 407, then:

        1. If request's window is @@ -4857,12 +4846,11 @@ Range Requests. [[HTTP-RANGE]] However, this is not widely supported by b

        2. Wait until all the headers are transmitted.

        3. -

          Any responses whose - status is in the range 100 to - 199, inclusive, and is not 101, are to be ignored. +

          Any responses whose status is in the range 100 to 199, + inclusive, and is not 101, are to be ignored. -

          These kind of responses are - eventually followed by a "final" response. +

          These kind of responses are eventually followed by a + "final" response.

          The exact layering between Fetch and HTTP still needs to be sorted through and @@ -5530,9 +5518,8 @@ objects. remove privileged no-CORS request headers from headers.

        -

        To fill a -{{Headers}} object (headers) with a given object (object), -run these steps: +

        To fill a {{Headers}} object +headers with a given object object, run these steps:

        1. @@ -5569,76 +5556,66 @@ from a {{Headers}} object (headers), run these steps:

          This is called when headers are modified by unprivileged code.

          The -Headers(init) -constructor, when invoked, must run these steps: +new Headers(init) +constructor steps are:

            -
          1. Let headers be a new {{Headers}} object whose - guard is "none". - -

          2. If init is given, then fill headers with - init. +

          3. Set this's guard to "none". -

          4. Return headers. +

          5. If init is given, then fill this with init.

          The append(name, value) -method, when invoked, must append name/value to the -context object. +method steps are to append name/value to this. -

          The delete(name) -method, when invoked, must run these steps: +

          The delete(name) method steps are:

          1. If name is not a name, then throw a {{TypeError}}. -

          2. If the context object's guard is "immutable", then - throw a {{TypeError}}. +

          3. If this's guard is "immutable", then throw a + {{TypeError}}. -

          4. Otherwise, if the context object's guard is "request" - and name is a forbidden header name, return. +

          5. Otherwise, if this's guard is "request" and + name is a forbidden header name, return. -

          6. Otherwise, if the context object's guard is - "request-no-cors", name is not a - no-CORS-safelisted request-header name, and name is not a - privileged no-CORS request-header name, return. +

          7. Otherwise, if this's guard is "request-no-cors", + name is not a no-CORS-safelisted request-header name, and name is not + a privileged no-CORS request-header name, return. -

          8. Otherwise, if the context object's guard is - "response" and name is a forbidden response-header name, return. +

          9. Otherwise, if this's guard is "response" and + name is a forbidden response-header name, return. -

          10. If the context object's header list does not - contain name, then return. +

          11. If this's header list does not contain + name, then return. -

          12. Delete name from the context object's +

          13. Delete name from this's header list. -

          14. If the context object's guard is "request-no-cors", - then remove privileged no-CORS request headers from the context object. +

          15. If this's guard is "request-no-cors", then + remove privileged no-CORS request headers from this.

          -

          The get(name) method, when -invoked, must run these steps: +

          The get(name) method steps are:

          1. If name is not a name, then throw a {{TypeError}}. -

          2. Return the result of getting name from the - context object's header list. +

          3. Return the result of getting name from this's + header list.

          -

          The has(name) method, -when invoked, must run these steps: +

          The has(name) method steps are:

          1. If name is not a name, then throw a {{TypeError}}. -

          2. Return true if the context object's header list - contains name, and false otherwise. +

          3. Return true if this's header list + contains name; otherwise false.

          -

          The -set(name, value) -method, when invoked, must run these steps: +

          The set(name, value) +method steps are:

          1. Normalize value. @@ -5646,29 +5623,27 @@ method, when invoked, must run these steps:

          2. If name is not a name or value is not a value, then throw a {{TypeError}}. -

          3. If the context object's guard is "immutable", then - throw a {{TypeError}}. +

          4. If this's guard is "immutable", then throw a + {{TypeError}}. -

          5. Otherwise, if the context object's guard is "request" - and name is a forbidden header name, return. +

          6. Otherwise, if this's guard is "request" and + name is a forbidden header name, return. -

          7. Otherwise, if the context object's guard is - "request-no-cors" and name/value is not a - no-CORS-safelisted request-header, return. +

          8. Otherwise, if this's guard is "request-no-cors" and + name/value is not a no-CORS-safelisted request-header, return. -

          9. Otherwise, if the context object's guard is - "response" and name is a forbidden response-header name, return. +

          10. Otherwise, if this's guard is "response" and + name is a forbidden response-header name, return. -

          11. Set name/value in the context object's +

          12. Set name/value in this's header list. -

          13. If the context object's guard is "request-no-cors", - then remove privileged no-CORS request headers from the context object. +

          14. If this's guard is "request-no-cors", then + remove privileged no-CORS request headers from this.

          The value pairs to iterate over are the return value of running -sort and combine with the context object's -header list. +sort and combine with this's header list.

          Body mixin

          @@ -5822,25 +5797,24 @@ due course. a MIME type (failure or a MIME type).

          An object implementing the {{Body}} mixin is said to be -disturbed if body is -non-null and its stream is +disturbed if its body is +non-null and its body's stream is disturbed.

          An object implementing the {{Body}} mixin is said to be -locked if body is -non-null and its stream is -locked. +locked if its body is non-null and +its body's stream is locked. -

          The body attribute's getter must return null if -body is null and body's stream otherwise. +

          The body getter steps are to return null if +this's body is null; otherwise this's body's +stream. -

          The bodyUsed attribute's getter must -return true if disturbed, and false otherwise. +

          The bodyUsed getter steps are to return true if +this is disturbed; otherwise false. -

          Objects implementing the {{Body}} mixin also have an associated -package data algorithm, given -bytes, a type and a mimeType, switches on type, and -runs the associated steps: +

          The package data algorithm, given +bytes, type, and a mimeType, switches on type, and runs +the associated steps:

          ArrayBuffer @@ -5917,54 +5891,45 @@ runs the associated steps: bytes.
          -

          Objects implementing the {{Body}} mixin also have an associated -consume body algorithm, given a type, -runs these steps: +

          The consume body algorithm, given an +object and type, runs these steps:

            -
          1. If this object is disturbed or locked, return a new promise - rejected with a {{TypeError}}. +

          2. If object is disturbed or locked, then return + a promise rejected with a {{TypeError}}. -

          3. Let stream be body's - stream if body is - non-null, or an empty - {{ReadableStream}} object otherwise. +

          4. Let stream be object's body's stream + if object's body is non-null; otherwise an empty + {{ReadableStream}} object. -

          5. Let reader be the result of getting - a reader from stream. If that threw an exception, return a new promise rejected - with that exception. +

          6. Let reader be the result of + getting a reader from stream. If that threw + an exception, return a promise rejected with that exception.

          7. Let promise be the result of - reading all bytes from - stream with reader. - -

          8. Return the result of transforming promise by a fulfillment handler that - returns the result of the package data algorithm - with its first argument, type and this object's - MIME type. - + reading all bytes from stream with + reader. + +

          9. Let steps be to return the result of package data with the first argument + given, type, and object's MIME type. + +

          10. Return the result of upon fulfillment of promise given steps.

          -

          The arrayBuffer() -method, when invoked, must return the result of running -consume body with ArrayBuffer. +

          The arrayBuffer() method steps are to return the result +of running consume body with this and ArrayBuffer. -

          The blob() method, when -invoked, must return the result of running -consume body with Blob. +

          The blob() method steps are to return the result of +running consume body with this and Blob. -

          The formData() method, -when invoked, must return the result of running -consume body with FormData. +

          The formData() method steps are to return the result of +running consume body with this and FormData. -

          The json() method, when -invoked, must return the result of running -consume body with JSON. +

          The json() method steps are to return the result of +running consume body with this and JSON. -

          The text() method, when -invoked, must return the result of running -consume body with text. +

          The text() method steps are to return the result of +running consume body with this and text.

          Request class

          @@ -6169,8 +6134,8 @@ initially a new {{AbortSignal}} object.

          The -Request(input, init) -constructor must run these steps: +new Request(input, init) +constructor steps are:

          1. Let request be null. @@ -6179,7 +6144,7 @@ constructor must run these steps:

          2. Let fallbackCredentials be null. -

          3. Let baseURL be current settings object's +

          4. Let baseURL be this's relevant settings object's API base URL.

          5. Let signal be null. @@ -6206,16 +6171,18 @@ constructor must run these steps:

        2. -

          Otherwise (input is a {{Request}} object): +

          Otherwise:

            +
          1. Assert: input is a {{Request}} object. +

          2. Set request to input's request.

          3. Set signal to input's signal.

          -
        3. Let origin be current settings object's +

        4. Let origin be this's relevant settings object's origin.

        5. Let window be "client". @@ -6223,7 +6190,7 @@ constructor must run these steps:

        6. If request's window is an environment settings object and its origin is same origin with - origin, set window to request's + origin, then set window to request's window.

        7. If init["{{RequestInit/window}}"] exists and is non-null, then @@ -6249,7 +6216,7 @@ constructor must run these steps:

          Set.
          client -
          Current settings object. +
          This's relevant settings object.
          window
          window. @@ -6408,12 +6375,12 @@ constructor must run these steps:
        8. If init["{{RequestInit/signal}}"] exists, then set signal to it. -

        9. Let r be a new {{Request}} object associated with request. +

        10. Set this's request to request. -

        11. If signal is not null, then make r's signal +

        12. If signal is not null, then make this's signal follow signal. -

        13. Set r's headers to a new {{Headers}} object, whose +

        14. Set this's headers to a new {{Headers}} object, whose header list is request's header list, and guard is "request". @@ -6425,23 +6392,23 @@ constructor must run these steps: API.

            -
          1. Let headers be a copy of r's headers and its +

          2. Let headers be a copy of this's headers and its associated header list.

          3. If init["{{RequestInit/headers}}"] exists, then set headers to init["{{RequestInit/headers}}"]. -

          4. Empty r's headers's header list. +

          5. Empty this's headers's header list.

          6. -

            If r's request's mode is +

            If this's request's mode is "no-cors", then:

              -
            1. If r's request's method is not a +

            2. If this's request's method is not a CORS-safelisted method, then throw a {{TypeError}}. -

            3. Set r's headers's guard to +

            4. Set this's headers's guard to "request-no-cors".

          7. @@ -6449,9 +6416,9 @@ constructor must run these steps:
          8. If headers is a Headers object, then for each header in its header list, append header's name/header's value to - r's {{Headers}} object. + this's headers. -

          9. Otherwise, fill r's {{Headers}} object with +

          10. Otherwise, fill this's headers with headers.

        15. @@ -6479,20 +6446,20 @@ constructor must run these steps:
        16. Otherwise, set body and Content-Type to the result of extracting init["{{RequestInit/body}}"]. -

        17. If Content-Type is non-null and r's headers's +

        18. If Content-Type is non-null and this's headers's header list does not contain `Content-Type`, then append - `Content-Type`/Content-Type to r's headers. + `Content-Type`/Content-Type to this's headers.

      4. If body is non-null and body's source is null, then:

          -
        1. If r's request's mode is neither +

        2. If this's request's mode is neither "same-origin" nor "cors", then throw a {{TypeError}}. -

        3. Set r's request's +

        4. Set this's request's use-CORS-preflight flag.

        @@ -6524,84 +6491,82 @@ constructor must run these steps: whose total bytes is inputBody's total bytes.
      -
    8. Set r's request's body to body. +

    9. Set this's request's body to body. -

    10. Set r's MIME type to the result of - extracting a MIME type from r's request's +

    11. Set this's MIME type to the result of + extracting a MIME type from this's request's header list. - -

    12. Return r.

    -

    The method attribute's getter, when invoked, must -return the context object's request's method. +

    The method getter steps are to return this's +request's method. -

    The url attribute's getter, when invoked, must -return the context object's request's URL, -serialized. +

    The url getter steps are to return this's +request's URL, serialized. -

    The headers attribute's getter, when invoked, must -return the context object's headers. +

    The headers getter steps are to return +this's headers. -

    The destination attribute's getter, when invoked, -must return the context object's request's destination. +

    The destination getter are to return this's +request's destination. -

    The referrer attribute's getter, when invoked, must -return the empty string if the context object's request's -referrer is "no-referrer", "about:client" if the -context object's request's referrer is -"client", and the context object's request's -referrer, serialized, otherwise. +

    The referrer getter steps are: -

    The referrerPolicy attribute's getter, when -invoked, must return the context object's request's -referrer policy. +

      +
    1. If this's request's referrer is + "no-referrer", then return the empty string. -

      The mode attribute's getter, when invoked, must -return the context object's request's mode. +

    2. If this's request's referrer is + "client", then return "about:client". -

      The credentials attribute's getter, when invoked, -must return the context object's request's -credentials mode. +

    3. Return this's request's referrer, + serialized. +

    -

    The cache attribute's getter, when invoked, must -return the context object's request's cache mode. +

    The referrerPolicy getter steps are to return +this's request's referrer policy. -

    The redirect attribute's getter, when invoked, must -return the context object's request's redirect mode. +

    The mode getter steps are to return this's +request's mode. -

    The integrity attribute's getter, when invoked, -must return the context object's request's -integrity metadata. +

    The credentials getter steps are to return +this's request's credentials mode. -

    The keepalive attribute's getter, when invoked, -must return true if the context object's request's keepalive flag -is set, and false otherwise. +

    The cache getter steps are to return this's +request's cache mode. -

    The isReloadNavigation attribute's getter, when -invoked, must return true if the context object's request's -reload-navigation flag is set, and false otherwise. +

    The redirect getter steps are to return +this's request's redirect mode. -

    The isHistoryNavigation attribute's getter, when -invoked, must return true if the context object's request's -history-navigation flag is set, and false otherwise. +

    The integrity getter steps are to return +this's request's integrity metadata. -

    The signal attribute's getter, when invoked, must -return the context object's signal. +

    The keepalive getter steps are to return true if +this's request's keepalive flag is set; otherwise false. + +

    The isReloadNavigation getter steps are to return +true if this's request's reload-navigation flag is set; +otherwise false. + +

    The isHistoryNavigation getter steps are to return +true if this's request's history-navigation flag is +set; otherwise false. + +

    The signal getter steps are to return this's +signal.


    -

    The clone() method, when invoked, must -run these steps: +

    The clone() method steps are:

      -
    1. If the context object is disturbed or locked, then - throw a {{TypeError}}. +

    2. If this is disturbed or locked, then throw a + {{TypeError}}.

    3. Let clonedRequestObject be a new {{Request}} object. -

    4. Let clonedRequest be the result of cloning the - context object's request. +

    5. Let clonedRequest be the result of cloning + this's request.

    6. Set clonedRequestObject's request to clonedRequest. @@ -6614,12 +6579,12 @@ run these steps:

      clonedRequest's header list.
      guard -
      The context object's headers's guard. +
      This's headers's guard.
    7. Make clonedRequestObject's signal - follow the context object's signal. + follow this's signal.

    8. Return clonedRequestObject.

    @@ -6667,30 +6632,30 @@ enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredire response's body.

    The -Response(body, init) -constructor, when invoked, must run these steps: +new Response(body, init) +constructor steps are:

      -
    1. If init["{{ResponseInit/status}}"] is not in the range 200 to - 599, inclusive, then throw a RangeError. +

    2. If init["{{ResponseInit/status}}"] is not in the range 200 to 599, inclusive, + then throw a {{RangeError}}.

    3. If init["{{ResponseInit/statusText}}"] does not match the reason-phrase token production, then throw a {{TypeError}}. -

    4. Let r be a new {{Response}} object associated with a new response. +

    5. Set this's response to a new response. -

    6. Set r's headers to a new {{Headers}} object, whose +

    7. Set this's headers to a new {{Headers}} object, whose header list is r's response's header list, and guard is "response". -

    8. Set r's response's status to +

    9. Set this's response's status to init["{{ResponseInit/status}}"]. -

    10. Set r's response's status message to +

    11. Set this's response's status message to init["{{ResponseInit/statusText}}"].

    12. If init["{{ResponseInit/headers}}"] exists, then - fill r's headers with + fill this's headers with init["{{ResponseInit/headers}}"].

    13. @@ -6701,35 +6666,31 @@ constructor, when invoked, must run these steps:

      If init["{{ResponseInit/status}}"] is a null body status, then throw a {{TypeError}}. -

      101 is included in - null body status due to its use elsewhere. It does not affect this step. +

      101 is included in null body status due to its use elsewhere. + It does not affect this step.

    14. Let Content-Type be null. -

    15. Set r's response's body and +

    16. Set this's response's body and Content-Type to the result of extracting body. -

    17. If Content-Type is non-null and r's response's +

    18. If Content-Type is non-null and this's response's header list does not contain `Content-Type`, then append - `Content-Type`/Content-Type to r's + `Content-Type`/Content-Type to this's response's header list.

    -
  • Set r's MIME type to the result of - extracting a MIME type from r's response's +

  • Set this's MIME type to the result of + extracting a MIME type from this's response's header list. -

  • Set r's response's - HTTPS state to - current settings object's +

  • Set this's response's HTTPS state to + this's relevant settings object's HTTPS state. - -

  • Return r. -

    The static error() method, when invoked, must run -these steps: +

    The static error() method steps are:

    1. Let r be a new {{Response}} object, whose response is a new @@ -6742,8 +6703,8 @@ these steps:

    The static -redirect(url, status) -method, when invoked, must run these steps: +redirect(url, status) method steps +are:

    1. Let parsedURL be the result of @@ -6753,8 +6714,7 @@ method, when invoked, must run these steps:

    2. If parsedURL is failure, then throw a {{TypeError}}. -

    3. If status is not a redirect status, then throw a - RangeError. +

    4. If status is not a redirect status, then throw a {{RangeError}}.

    5. Let r be a new {{Response}} object, whose response is a new response. @@ -6765,64 +6725,63 @@ method, when invoked, must run these steps:

    6. Set r's response's status to status. -

    7. Append `Location` to parsedURL, - serialized and isomorphic encoded, in r's +

    8. Let value be parsedURL, serialized and + isomorphic encoded. + +

    9. Append `Location`/value to r's response's header list.

    10. Return r.

    -

    The type attribute's getter, when invoked, must -return the context object's response's type. +

    The type getter steps are to return this's +response's type. -

    The url attribute's getter, when invoked, must -return the empty string if the context object's response's -URL is null and the context object's response's -URL, serialized with the exclude-fragment flag -set, otherwise. [[!URL]] +

    The url getter steps are to return +the empty string if this's response's URL is null; +otherwise this's response's URL, +serialized with the exclude-fragment flag set. [[!URL]] -

    The redirected attribute's getter, when invoked, -must return true if the context object's response's -URL list has more than one item, and false otherwise. +

    The redirected getter steps are to return true if +this's response's URL list has more than one item; +otherwise false.

    To filter out responses that are the result of a redirect, do this directly through the API, e.g., fetch(url, { redirect:"error" }). This way a potentially unsafe response cannot accidentally leak. -

    The status attribute's getter, when invoked, must -return the context object's response's status. +

    The status getter steps are to return +this's response's status. -

    The ok attribute's getter, when invoked, must -return true if the context object's response's status -is an ok status, and false otherwise. +

    The ok getter steps are to return true if +this's response's status is an ok status; +otherwise false. -

    The statusText attribute's getter, when invoked, -must return the context object's response's -status message. +

    The statusText getter steps are to return +this's response's status message. -

    The headers attribute's getter, when invoked, must -return the context object's headers. +

    The headers getter steps are to return +this's headers.


    -

    The clone() method, when invoked, must -run these steps: +

    The clone() method steps are:

      -
    1. If the context object is disturbed or locked, then - throw a {{TypeError}}. +

    2. If this is disturbed or locked, then throw a + {{TypeError}}.

    3. Let clonedResponseObject be a new {{Response}} object. -

    4. Let clonedResponse be the result of cloning the - context object's response. +

    5. Let clonedResponse be the result of cloning + this's response.

    6. Set clonedResponseObject's response to clonedResponse.

    7. Set clonedResponseObject's headers to a new {{Headers}} object whose header list is set to clonedResponse's - header list, and guard is the context object's + header list, and guard is this's headers's guard.

    8. Return clonedResponseObject. @@ -6841,14 +6800,14 @@ partial interface mixin WindowOrWorkerGlobalScope {

      The fetch(input, init) -method, must run these steps: +method steps are:

      1. Let p be a new promise.

      2. Let requestObject be the result of invoking the initial value of {{Request}} as constructor with input and init as arguments. If this throws an exception, - reject p with it and return p. + reject p with it and return p.

      3. Let request be requestObject's request. @@ -6903,12 +6862,12 @@ method, must run these steps: with p, request, and responseObject, and terminate these substeps. -

      4. If response is a network error, then reject p with a - {{TypeError}} and terminate these substeps. +

      5. If response is a network error, then reject p + with a {{TypeError}} and terminate these substeps.

      6. Associate responseObject with response. -

      7. Resolve p with responseObject. +

      8. Resolve p with responseObject.

    9. Return p. @@ -6921,7 +6880,7 @@ method, must run these steps:

    10. Let error be an "AbortError" {{DOMException}}.

    11. -

      Reject promise with error. +

      Reject promise with error.

      This is a no-op if promise has already fulfilled. @@ -7112,9 +7071,8 @@ therefore not shareable, a WebSocket connection is very close to identical to an

    12. Let response be the result of fetching request. -

    13. If response is a network error or its - status is not 101, - fail the WebSocket connection. +

    14. If response is a network error or its status is not + 101, fail the WebSocket connection.

    15. If protocols is not the empty list and extracting header list values given