From 93b434967a366e7672063b6d2d1caa11e2dca43b Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 11 Dec 2019 13:31:47 +0100 Subject: [PATCH] Remove trailer support As noted in https://github.com/whatwg/fetch/issues/772#issuecomment-564515727 the current way it is exposed subsets what HTTP supports and therefore does not feel like a good starting point. Both for the internal and public API. Additionally, the public-facing API has not seen interest from implementers, at least for the past year and a half. --- fetch.bs | 89 +++++--------------------------------------------------- 1 file changed, 8 insertions(+), 81 deletions(-) diff --git a/fetch.bs b/fetch.bs index 6c07d7ff3..b723cb5a6 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1764,14 +1764,6 @@ message as HTTP/2 does not support them. body (null or a body). Unless stated otherwise it is null. -

A response has an associated -trailer (a -header list). Unless stated otherwise it is empty. - -

A response has an associated -trailer failed flag, which is -initially unset. -

A response has an associated cache state (the empty string or "local"). Unlesss stated otherwise, it is the empty string. @@ -1842,9 +1834,8 @@ known as an aborted network errorresponse whose status is always 0, status message is always the empty byte sequence, -header list is always empty, -body is always null, and -trailer is always empty. +header list is always empty, and +body is always null.


@@ -1873,7 +1864,7 @@ which is only "accessible" to internal specification algorithms and is never a

A CORS filtered response is a filtered response whose -type is "cors", +type is "cors" and header list excludes any headers in internal response's @@ -1881,8 +1872,7 @@ which is only "accessible" to internal specification algorithms and is never a name is not a CORS-safelisted response-header name, given internal response's -CORS-exposed header-name list, and -trailer is empty. +CORS-exposed header-name list.

An opaque filtered response is a filtered response whose @@ -1890,9 +1880,8 @@ which is only "accessible" to internal specification algorithms and is never a URL list is the empty list, status is 0, status message is the empty byte sequence, -header list is empty, -body is null, and -trailer is empty. +header list is empty, and +body is null.

An opaque-redirect filtered response @@ -1900,9 +1889,8 @@ is a filtered response whose type is "opaqueredirect", status is 0, status message is the empty byte sequence, -header list is empty, -body is null, and -trailer is empty. +header list is empty, and +body is null.

Exposing the URL list for @@ -3649,14 +3637,6 @@ optionally with a recursive flag, run these steps:

  • Queue a fetch task on request to process response end-of-body for response. -

  • Wait for either internalResponse's trailer, - if any, or for the ongoing fetch to terminate. See - section 4.1.2 of - [[!HTTP]]. - -

  • If the ongoing fetch is terminated, then set internalResponse's - trailer failed flag. -

  • Set request's done flag.

  • Queue a fetch task on request to process response done @@ -6396,7 +6376,6 @@ interface Response { readonly attribute boolean ok; readonly attribute ByteString statusText; [SameObject] readonly attribute Headers headers; - readonly attribute Promise<Headers> trailer; [NewObject] Response clone(); }; @@ -6418,10 +6397,6 @@ enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredire

    A {{Response}} object also has an associated headers (null or a {{Headers}} object), initially null. -

    A {{Response}} object also has an associated -trailer promise (a promise). Used -for the {{Response/trailer}} attribute. -

    A {{Response}} object's body is its response's body. @@ -6484,10 +6459,6 @@ constructor, when invoked, must run these steps: current settings object's HTTPS state. -

  • Resolve r's trailer promise - with a new {{Headers}} object whose guard is - "immutable". -

  • Return r. @@ -6566,9 +6537,6 @@ must return the context object's response's

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

    The trailer attribute's getter, when invoked, must -return the context object's trailer promise. -


    The clone() method, when invoked, must @@ -6591,11 +6559,6 @@ run these steps: header list, and guard is the context object's headers's guard. -

  • Upon fulfillment of the context object's trailer promise, resolve - clonedResponseObject's trailer promise with a new {{Headers}} object - whose guard is "immutable", and whose - header list is clonedResponse's trailer. -

  • Return clonedResponseObject.

  • Return clonedResponse. @@ -6682,36 +6645,6 @@ method, must run these steps:

  • Resolve p with responseObject. -

    To process response done for response, run these substeps: - -

      -
    1. If locallyAborted is true, terminate these substeps. - -

    2. Let trailerObject be a new {{Headers}} object whose - guard is "immutable". - -

    3. -

      If response's trailer failed flag is set, then: - -

        -
      1. If response's aborted flag is set, reject - responseObject's trailer promise with an - "AbortError" {{DOMException}}. - -

      2. Otherwise, reject responseObject's trailer promise with - a {{TypeError}}. - -

      3. Terminate these substeps. -

      - -
    4. Associate trailerObject with response's - trailer. - -

    5. Resolve responseObject's - trailer promise with - trailerObject. -

    -
  • Return p. @@ -6732,12 +6665,6 @@ method, must run these steps:

  • If responseObject is null, then return. -

  • -

    Reject responseObject's trailer promise with error. - -

    This is a no-op if responseObject's trailer promise - has already fulfilled. -

  • Let response be responseObject's response.

  • If response's body is not null and is