From 2c939cb4848a83d396d5e59ed64fe78f09c6d0a4 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Wed, 11 Dec 2024 15:38:31 -0700 Subject: [PATCH 01/21] Add Content Encoding response header to fetch. --- fetch.bs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/fetch.bs b/fetch.bs index 5cbfef674..572db72cf 100644 --- a/fetch.bs +++ b/fetch.bs @@ -370,6 +370,8 @@ following items: [[RESOURCE-TIMING]] [[NAVIGATION-TIMING]]
A number.
content type (default the empty string)
An ASCII string. +
content encoding (default the empty string) +
An ASCII string.
@@ -1132,6 +1134,7 @@ a byte-case-insensitive match for one of
  • `Content-Language`
  • `Content-Length`
  • `Content-Type` +
  • `Content-Encoding`
  • `Expires`
  • `Last-Modified`
  • `Pragma` @@ -1147,6 +1150,7 @@ is a byte-case-insensitive match for one of
  • `Accept-Language`
  • `Content-Language`
  • `Content-Type` +
  • `Content-Encoding`
    @@ -3946,6 +3950,40 @@ Content-Type:
  • +

    `Content-Encoding` header

    + +

    The `Content-Encoding` header is largely defined in HTTP. Its processing model is +defined here as the model defined in HTTP is not compatible with web content. [[HTTP]] + +

    +

    To +extract an encoding type from a header list headers, run these steps: + +

      +
    1. Let values be the result of + getting, decoding, and splitting `Content-Encoding` from + headers. + +

    2. If values is null, then return null. + +

    3. Let candidateValue be null. + +

    4. +

      For each value of values: + +

        +
      1. If candidateValue is null, then set candidateValue to + value. + +

      2. Otherwise, if value is not candidateValue, return failure. +

      + +
    5. If candidateValue is the empty string or has a code point that is + not an ASCII digit, then return null. + +

    6. Return candidateValue, interpreted as a string. +

    +

    `X-Content-Type-Options` header

    @@ -9127,6 +9165,7 @@ Gavin Carothers, Glenn Maynard, Graham Klyne, Gregory Terzian, +Guohui Deng, Hal Lockhart, Hallvord R. M. Steen, Harris Hancock, From dc2b573104ee9f92144ab1f4a0e32e38e4fe190a Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 12 Dec 2024 15:03:12 -0700 Subject: [PATCH 02/21] Add more about content-encoding And some corrections. --- fetch.bs | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/fetch.bs b/fetch.bs index 572db72cf..ae5f361c2 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1134,7 +1134,6 @@ a byte-case-insensitive match for one of
  • `Content-Language`
  • `Content-Length`
  • `Content-Type` -
  • `Content-Encoding`
  • `Expires`
  • `Last-Modified`
  • `Pragma` @@ -1150,7 +1149,6 @@ is a byte-case-insensitive match for one of
  • `Accept-Language`
  • `Content-Language`
  • `Content-Type` -
  • `Content-Encoding`
    @@ -1180,6 +1178,7 @@ is a byte-case-insensitive match for one of
  • `Access-Control-Request-Headers`
  • `Access-Control-Request-Method`
  • `Connection` +
  • `Content-Encoding`
  • `Content-Length`
  • `Cookie`
  • `Cookie2` @@ -5042,6 +5041,12 @@ steps:
  • Let type be blob's {{Blob/type}}. +

  • Let accept-coding be the result of getting + `Content-Encoding` from request's header list. + If accept-encoding is not null and the server selects one of the encoding options, + let coding be the selected encoding option; otherwise, i.e., let coding + be null. +

  • If request's header list does not contain `Range`: @@ -5058,6 +5063,10 @@ steps:

  • Set response's header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type) ». + +

  • If coding is non-null, append (`Content-Encoding`, + coding) to response's header list. +

  • @@ -5127,6 +5136,9 @@ steps: (`Content-Length`, serializedSlicedLength), (`Content-Type`, type), (`Content-Range`, contentRange) ». + +
  • If coding is non-null, append (`Content-Encoding`, + coding) to response's header list.

  • Return response. @@ -5143,10 +5155,28 @@ steps:

  • Let mimeType be dataURLStruct's MIME type, serialized. -

  • Return a new response whose status message is - `OK`, header list is « (`Content-Type`, - mimeType) », and body is dataURLStruct's - body as a body. +

  • Let accept-coding be the result of getting + `Content-Encoding` from request's header list. + If accept-encoding is not null and the server selects one of the encoding options, + let coding be the selected encoding option; otherwise, i.e., let coding + be null. +

  • Let response be a new response. + +

  • Set response's status message to + OK`. + +

  • Set response's header list to « + (`Content-Type`, mimeType)». + +

  • If coding is non-null, append + (`Content-Encoding`, coding) to response's + header list. + +

  • Set response's body to dataURLStruct's + body + +

  • Return response. +

    "file" @@ -9165,7 +9195,7 @@ Gavin Carothers, Glenn Maynard, Graham Klyne, Gregory Terzian, -Guohui Deng, +Guohui Deng(邓国辉), Hal Lockhart, Hallvord R. M. Steen, Harris Hancock, From 7647a50a7ea4439ee19696f679de657ec97ff399 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Fri, 13 Dec 2024 10:10:38 -0700 Subject: [PATCH 03/21] Remove a trailing space. --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index ae5f361c2..3b4e18347 100644 --- a/fetch.bs +++ b/fetch.bs @@ -5168,7 +5168,7 @@ steps:
  • Set response's header list to « (`Content-Type`, mimeType)». -

  • If coding is non-null, append +

  • If coding is non-null, append (`Content-Encoding`, coding) to response's header list. From f7bdfa950870cd978832dcbd03e79fbfae549201 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Mon, 16 Dec 2024 14:48:34 -0700 Subject: [PATCH 04/21] content-encoding always available --- fetch.bs | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) mode change 100644 => 100755 fetch.bs diff --git a/fetch.bs b/fetch.bs old mode 100644 new mode 100755 index 3b4e18347..1c6f3f508 --- a/fetch.bs +++ b/fetch.bs @@ -5042,10 +5042,11 @@ steps:

  • Let type be blob's {{Blob/type}}.

  • Let accept-coding be the result of getting - `Content-Encoding` from request's header list. + `Accept-Encoding` from request's header list. If accept-encoding is not null and the server selects one of the encoding options, - let coding be the selected encoding option; otherwise, i.e., let coding - be null. + let coding be the selected encoding option; otherwise, i.e., no encoding is used, + let coding be + "identity".

  • If request's header list @@ -5062,10 +5063,8 @@ steps:

  • Set response's header list to « (`Content-Length`, serializedFullLength), - (`Content-Type`, type) ». - -

  • If coding is non-null, append (`Content-Encoding`, - coding) to response's header list. + (`Content-Type`, type), + (`Content-Encoding`, coding) ». @@ -5135,10 +5134,8 @@ steps:

  • Set response's header list to « (`Content-Length`, serializedSlicedLength), (`Content-Type`, type), (`Content-Range`, - contentRange) ». + contentRange), (`Content-Encoding`, coding) ». -

  • If coding is non-null, append (`Content-Encoding`, - coding) to response's header list.

  • Return response. @@ -5156,26 +5153,17 @@ steps: MIME type, serialized.

  • Let accept-coding be the result of getting - `Content-Encoding` from request's header list. + `Accept-Encoding` from request's header list. If accept-encoding is not null and the server selects one of the encoding options, - let coding be the selected encoding option; otherwise, i.e., let coding - be null. -

  • Let response be a new response. - -

  • Set response's status message to - OK`. - -

  • Set response's header list to « - (`Content-Type`, mimeType)». - -

  • If coding is non-null, append - (`Content-Encoding`, coding) to response's - header list. - -

  • Set response's body to dataURLStruct's - body - -

  • Return response. + let coding be the selected encoding option; otherwise, i.e., no encoding is used, + let coding be + "identity". + +

  • Return a new response whose status message is + `OK`, header list is « (`Content-Type`, + mimeType), (`Content-Encoding`, coding) », and + body is dataURLStruct's + body as a body. From 94ecd4c65defe97e4ed73d52730a89c8195bda02 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Tue, 14 Jan 2025 14:11:06 -0700 Subject: [PATCH 05/21] Fix indentation and the "let" in the middle of sentence. --- fetch.bs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fetch.bs b/fetch.bs index 1c6f3f508..11ea71c4c 100755 --- a/fetch.bs +++ b/fetch.bs @@ -5041,11 +5041,13 @@ steps:

  • Let type be blob's {{Blob/type}}. +

  • Let coding be the empty string. +

  • Let accept-coding be the result of getting - `Accept-Encoding` from request's header list. + `Accept-Encoding` from request's header list. If accept-encoding is not null and the server selects one of the encoding options, - let coding be the selected encoding option; otherwise, i.e., no encoding is used, - let coding be + set coding to the selected encoding option; otherwise, i.e., no encoding is used, + set coding to "identity".

  • @@ -5152,11 +5154,13 @@ steps:
  • Let mimeType be dataURLStruct's MIME type, serialized. +

  • Let coding be the empty string. +

  • Let accept-coding be the result of getting - `Accept-Encoding` from request's header list. + `Accept-Encoding` from request's header list. If accept-encoding is not null and the server selects one of the encoding options, - let coding be the selected encoding option; otherwise, i.e., no encoding is used, - let coding be + set coding to the selected encoding option; otherwise, i.e., no encoding is used, + set coding to "identity".

  • Return a new response whose status message is From a00761414a5e328f277c609e44e552f73be90fea Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Tue, 21 Jan 2025 16:22:32 -0700 Subject: [PATCH 06/21] Fix a number of issues: 1) formatting; 2) "gzip, GZIP" is ok for they case-insensitive match. 3) there is a mistake saying that the "contentEncoding" consists of digits; 4) no longer returns "contentEncoding" for data url. --- fetch.bs | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/fetch.bs b/fetch.bs index fd1545211..c2562d132 100755 --- a/fetch.bs +++ b/fetch.bs @@ -3973,12 +3973,10 @@ extract an encoding type from a header list headers

    If candidateValue is null, then set candidateValue to value. -

  • Otherwise, if value is not candidateValue, return failure. +

  • Otherwise, if value is not an ASCII case-insensitive match for + candidateValue, return failure. -

  • If candidateValue is the empty string or has a code point that is - not an ASCII digit, then return null. -

  • Return candidateValue, interpreted as a string. @@ -5047,12 +5045,12 @@ steps:

  • Let coding be the empty string. -

  • Let accept-coding be the result of getting - `Accept-Encoding` from request's header list. - If accept-encoding is not null and the server selects one of the encoding options, - set coding to the selected encoding option; otherwise, i.e., no encoding is used, - set coding to - "identity". +

  • Let accept-encoding be the result of getting + `Accept-Encoding` from request's header list. + If accept-encoding is not null and the server selects one of the encoding options, + set coding to the selected encoding option; otherwise, i.e., no encoding is used, + set coding to + "identity".

  • If request's header list @@ -5158,20 +5156,10 @@ steps:

  • Let mimeType be dataURLStruct's MIME type, serialized. -

  • Let coding be the empty string. - -

  • Let accept-coding be the result of getting - `Accept-Encoding` from request's header list. - If accept-encoding is not null and the server selects one of the encoding options, - set coding to the selected encoding option; otherwise, i.e., no encoding is used, - set coding to - "identity". -

  • Return a new response whose status message is `OK`, header list is « (`Content-Type`, - mimeType), (`Content-Encoding`, coding) », and - body is dataURLStruct's - body as a body. + mimeType) », and body is dataURLStruct's + body as a body. From 46c10a9ebf21f129dbfc5fc6e30015aa5e31e050 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Wed, 22 Jan 2025 11:37:42 -0700 Subject: [PATCH 07/21] Remove spurious new lines and correct a paragraph That's on the client side getting the reponse header. --- fetch.bs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/fetch.bs b/fetch.bs index c2562d132..475bcb3fd 100755 --- a/fetch.bs +++ b/fetch.bs @@ -5043,14 +5043,8 @@ steps:

  • Let type be blob's {{Blob/type}}. -

  • Let coding be the empty string. - -

  • Let accept-encoding be the result of getting - `Accept-Encoding` from request's header list. - If accept-encoding is not null and the server selects one of the encoding options, - set coding to the selected encoding option; otherwise, i.e., no encoding is used, - set coding to - "identity". +

  • Let contentEncoding be the result of getting + `Content-Encoding` from request's header list.

  • If request's header list @@ -5068,7 +5062,7 @@ steps:

  • Set response's header list to « (`Content-Length`, serializedFullLength), (`Content-Type`, type), - (`Content-Encoding`, coding) ». + (`Content-Encoding`, contentEncoding) ». @@ -5138,8 +5132,7 @@ steps:

  • Set response's header list to « (`Content-Length`, serializedSlicedLength), (`Content-Type`, type), (`Content-Range`, - contentRange), (`Content-Encoding`, coding) ». - + contentRange), (`Content-Encoding`, contentEncoding) ».

  • Return response. @@ -5160,7 +5153,6 @@ steps: `OK`, header list is « (`Content-Type`, mimeType) », and body is dataURLStruct's body as a body. -

    "file" From a96300830a9e4e1df2bc78649498717c114e85f8 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Wed, 22 Jan 2025 15:19:38 -0700 Subject: [PATCH 08/21] Simply Just add the content encoding to body info. --- fetch.bs | 45 +++++---------------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/fetch.bs b/fetch.bs index 475bcb3fd..3cee4f467 100755 --- a/fetch.bs +++ b/fetch.bs @@ -3948,39 +3948,6 @@ Content-Type: -

    `Content-Encoding` header

    - -

    The `Content-Encoding` header is largely defined in HTTP. Its processing model is -defined here as the model defined in HTTP is not compatible with web content. [[HTTP]] - -

    -

    To -extract an encoding type from a header list headers, run these steps: - -

      -
    1. Let values be the result of - getting, decoding, and splitting `Content-Encoding` from - headers. - -

    2. If values is null, then return null. - -

    3. Let candidateValue be null. - -

    4. -

      For each value of values: - -

        -
      1. If candidateValue is null, then set candidateValue to - value. - -

      2. Otherwise, if value is not an ASCII case-insensitive match for - candidateValue, return failure. -

      - -
    5. Return candidateValue, interpreted as a string. -

    -
    -

    `X-Content-Type-Options` header

    The @@ -5043,9 +5010,6 @@ steps:

  • Let type be blob's {{Blob/type}}. -

  • Let contentEncoding be the result of getting - `Content-Encoding` from request's header list. -

  • If request's header list does not contain `Range`: @@ -5061,9 +5025,7 @@ steps:

  • Set response's header list to « (`Content-Length`, serializedFullLength), - (`Content-Type`, type), - (`Content-Encoding`, contentEncoding) ». - + (`Content-Type`, type) ».

  • @@ -5132,7 +5094,7 @@ steps:
  • Set response's header list to « (`Content-Length`, serializedSlicedLength), (`Content-Type`, type), (`Content-Range`, - contentRange), (`Content-Encoding`, contentEncoding) ». + contentRange) ».

  • Return response. @@ -6359,6 +6321,9 @@ optional boolean forceNewConnection (default false), run these steps:

  • Let codings be the result of extracting header list values given `Content-Encoding` and response's header list. +

  • Set response's body info's + content encoding to codings. +

  • Increase response's body info's encoded size by bytes's length. From 16f1d1f5c3aa911873a87fa8789acc5b4bd85b75 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 23 Jan 2025 13:46:38 -0700 Subject: [PATCH 09/21] Fix: content-encoding not prohibited header. restore a new line. --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 3cee4f467..919470138 100755 --- a/fetch.bs +++ b/fetch.bs @@ -1178,7 +1178,6 @@ is a byte-case-insensitive match for one of

  • `Access-Control-Request-Headers`
  • `Access-Control-Request-Method`
  • `Connection` -
  • `Content-Encoding`
  • `Content-Length`
  • `Cookie`
  • `Cookie2` @@ -3948,6 +3947,7 @@ Content-Type: +

    `X-Content-Type-Options` header

    The From c5c0f55f25c880f93aa1b1c27a33a3bfa47201c1 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Wed, 29 Jan 2025 11:12:14 -0700 Subject: [PATCH 10/21] content-encoding should be a list of strings. --- fetch.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 919470138..88dcc50b5 100755 --- a/fetch.bs +++ b/fetch.bs @@ -370,8 +370,8 @@ following items: [[RESOURCE-TIMING]] [[NAVIGATION-TIMING]]

    A number.
    content type (default the empty string)
    An ASCII string. -
    content encoding (default the empty string) -
    An ASCII string. +
    content encoding (default « ») +
    A list of strings.
    From 3c5eb46dc4d7f85fbc93f50da04afa5343c2c291 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Fri, 7 Mar 2025 16:25:20 -0700 Subject: [PATCH 11/21] Add the text about "filtering Content-Encoding". --- fetch.bs | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/fetch.bs b/fetch.bs index 88dcc50b5..24355300f 100755 --- a/fetch.bs +++ b/fetch.bs @@ -3798,6 +3798,50 @@ from a header list headers, run these steps:
    +

    `Content-Encoding` header

    +

    The `Content-Encoding` header can contain an arbitrary value because +a proprietary compression can be used. Except as the response header, +`Content-Encoding` exposed anywhere else is subject to the filtering process +defined below. + +

    +

    To filter the `Content-Encoding`, run these steps. They +return a filtered Content-Encoding. +

    +
      +
    1. Let codings be the result of + getting, decoding, and splitting `Content-Encoding` from + headers. +

    2. +

      + If codings is null, return the empty string. +

      +
    3. +
    4. +

      + If codings contains two strings or more, return "multiple". +

      +
    5. +
    6. +

      + If codings[0] is the empty string, or it is supported by the user agent, + and is listed in the + + content encoding registry on IANA, return codings[0]. +

      +

      + "identity" is never supported as a coding. See details + + here. +

      +
    7. +
    8. +

      + Otherwise, return "unknown". +

      +
    9. +
    +

    `Content-Type` header

    From f41fa1f5d60e9ea8d6a9c70a366c1486a1c91777 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Fri, 7 Mar 2025 16:55:39 -0700 Subject: [PATCH 12/21] Move the filtering text. It should be before copying "content-encoding" value to response bodyinfo. --- fetch.bs | 61 ++++++++++++++------------------------------------------ 1 file changed, 15 insertions(+), 46 deletions(-) diff --git a/fetch.bs b/fetch.bs index 24355300f..b514306ae 100755 --- a/fetch.bs +++ b/fetch.bs @@ -3798,51 +3798,6 @@ from a header list headers, run these steps: -

    `Content-Encoding` header

    -

    The `Content-Encoding` header can contain an arbitrary value because -a proprietary compression can be used. Except as the response header, -`Content-Encoding` exposed anywhere else is subject to the filtering process -defined below. - -

    -

    To filter the `Content-Encoding`, run these steps. They -return a filtered Content-Encoding. -

    -
      -
    1. Let codings be the result of - getting, decoding, and splitting `Content-Encoding` from - headers. -

    2. -

      - If codings is null, return the empty string. -

      -
    3. -
    4. -

      - If codings contains two strings or more, return "multiple". -

      -
    5. -
    6. -

      - If codings[0] is the empty string, or it is supported by the user agent, - and is listed in the - - content encoding registry on IANA, return codings[0]. -

      -

      - "identity" is never supported as a coding. See details - - here. -

      -
    7. -
    8. -

      - Otherwise, return "unknown". -

      -
    9. -
    -
    -

    `Content-Type` header

    The `Content-Type` header is largely defined in HTTP. Its processing model is @@ -6365,8 +6320,22 @@ optional boolean forceNewConnection (default false), run these steps:

  • Let codings be the result of extracting header list values given `Content-Encoding` and response's header list. +

  • Let filteredCoding be "unknown". + +

  • If codings is null, set filteredCoding to the empty string. + +

  • If codings contains two strings or more, set filteredCoding to + "multiple". +

  • If codings[0] is the empty string, or it is supported by the user agent, + and is listed in the + content encoding registry on IANA, set filteredCoding to codings[0]. + +

    + "identity" is never supported as a coding. See details + here. +

  • Set response's body info's - content encoding to codings. + content encoding to filteredCoding.

  • Increase response's body info's encoded size by bytes's From 17cdde2ccdfb2bc477d7b56aac31753c4b12a360 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Fri, 7 Mar 2025 16:58:00 -0700 Subject: [PATCH 13/21] restore a deleted empty line. --- fetch.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch.bs b/fetch.bs index b514306ae..575eabe11 100755 --- a/fetch.bs +++ b/fetch.bs @@ -3798,6 +3798,7 @@ from a header list headers, run these steps: +

    `Content-Type` header

    The `Content-Type` header is largely defined in HTTP. Its processing model is From 16ac25e7041d54305964ee98fee4cbc4891fdb1b Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Sat, 8 Mar 2025 11:32:04 -0700 Subject: [PATCH 14/21] Add "Otherwise" --- fetch.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 575eabe11..66cca5d84 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6325,9 +6325,9 @@ optional boolean forceNewConnection (default false), run these steps:

  • If codings is null, set filteredCoding to the empty string. -

  • If codings contains two strings or more, set filteredCoding to +

  • Otherwise, if codings contains two strings or more, set filteredCoding to "multiple". -

  • If codings[0] is the empty string, or it is supported by the user agent, +

  • Otherwise, if codings[0] is the empty string, or it is supported by the user agent, and is listed in the content encoding registry on IANA, set filteredCoding to codings[0]. From af1709e749ffce32661ad61d8a142d269fb8bb75 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Sat, 8 Mar 2025 11:36:32 -0700 Subject: [PATCH 15/21] Add an empty line. --- fetch.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch.bs b/fetch.bs index 66cca5d84..00e1d014c 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6327,6 +6327,7 @@ optional boolean forceNewConnection (default false), run these steps:

  • Otherwise, if codings contains two strings or more, set filteredCoding to "multiple". +

  • Otherwise, if codings[0] is the empty string, or it is supported by the user agent, and is listed in the content encoding registry on IANA, set filteredCoding to codings[0]. From f121d66a1f2098955790ad983b277ac8ac9b8547 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Sat, 8 Mar 2025 11:41:41 -0700 Subject: [PATCH 16/21] Change "content-type" in "body info" to a string. --- fetch.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 00e1d014c..10e3d875d 100755 --- a/fetch.bs +++ b/fetch.bs @@ -370,8 +370,8 @@ following items: [[RESOURCE-TIMING]] [[NAVIGATION-TIMING]]

    A number.
    content type (default the empty string)
    An ASCII string. -
    content encoding (default « ») -
    A list of strings. +
    content encoding (default the empty string) +
    An ASCII string.
    From 28fd341daab64f8d4a004c8772a838af2ac90bf0 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Thu, 10 Apr 2025 14:14:47 -0600 Subject: [PATCH 17/21] fix a few errors. --- fetch.bs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fetch.bs b/fetch.bs index 10e3d875d..c65aad477 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6323,18 +6323,14 @@ optional boolean forceNewConnection (default false), run these steps:
  • Let filteredCoding be "unknown". -

  • If codings is null, set filteredCoding to the empty string. +

  • If codings is null, then set filteredCoding to the empty string. -

  • Otherwise, if codings contains two strings or more, set filteredCoding to +

  • Otherwise, if codings contains two strings or more, then set filteredCoding to "multiple". -

  • Otherwise, if codings[0] is the empty string, or it is supported by the user agent, +

  • Otherwise, if codings[0] is the empty string, or it is supported by the user agent, and is listed in the - content encoding registry on IANA, set filteredCoding to codings[0]. - -

    - "identity" is never supported as a coding. See details - here. + content encoding registry on IANA, then set filteredCoding to codings[0].

  • Set response's body info's content encoding to filteredCoding. From 7dd1ebac6ed5fdf028d38fb218eb196190e116c0 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Mon, 14 Apr 2025 16:12:31 -0600 Subject: [PATCH 18/21] Fix a few issues. --- fetch.bs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index c65aad477..1a2fd634d 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6325,15 +6325,18 @@ optional boolean forceNewConnection (default false), run these steps:

  • If codings is null, then set filteredCoding to the empty string. -

  • Otherwise, if codings contains two strings or more, then set filteredCoding to - "multiple". +

  • Otherwise, if codings's size is 2 or more, then set + filteredCoding to "multiple".

  • Otherwise, if codings[0] is the empty string, or it is supported by the user agent, - and is listed in the - content encoding registry on IANA, then set filteredCoding to codings[0]. + and is a byte-case-insensitive match for an entry listed in the + + HTTP Content Coding Registry of [[!IANA-HTTP-PARAMS]], then set + filteredCoding to codings[0].

  • Set response's body info's - content encoding to filteredCoding. + content encoding to the result of + byte-lowercasing filteredCoding.

  • Increase response's body info's encoded size by bytes's From c450e00e62e4f09268715f0c9f4cd5aabe8001cb Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Tue, 15 Apr 2025 09:50:52 -0600 Subject: [PATCH 19/21] Fix a few errors. --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index 1a2fd634d..a844def05 100755 --- a/fetch.bs +++ b/fetch.bs @@ -6325,18 +6325,18 @@ optional boolean forceNewConnection (default false), run these steps:

  • If codings is null, then set filteredCoding to the empty string. -

  • Otherwise, if codings's size is 2 or more, then set +

  • Otherwise, if codings's size is greater than 1, then set filteredCoding to "multiple".

  • Otherwise, if codings[0] is the empty string, or it is supported by the user agent, and is a byte-case-insensitive match for an entry listed in the HTTP Content Coding Registry of [[!IANA-HTTP-PARAMS]], then set - filteredCoding to codings[0]. + filteredCoding to the result of byte-lowercasing + codings[0].

  • Set response's body info's - content encoding to the result of - byte-lowercasing filteredCoding. + content encoding to filteredCoding.

  • Increase response's body info's encoded size by bytes's From 8b9182085e8fdd1fcc95ebb5d6eda5db0b849a1a Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Tue, 15 Apr 2025 10:09:21 -0600 Subject: [PATCH 20/21] Add IANA-HTTP-PARAMS reference --- fetch.bs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fetch.bs b/fetch.bs index a844def05..6fccf27cf 100755 --- a/fetch.bs +++ b/fetch.bs @@ -100,6 +100,11 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262 "href": "https://www.kb.cert.org/vuls/id/150227", "title": "HTTP proxy default configurations allow arbitrary TCP connections." }, + "IANA-HTTP-PARAMS": { + "href": "https://www.iana.org/assignments/http-parameters/http-parameters.xhtml", + "title": "Hypertext Transfer Protocol (HTTP) Parameters", + "publisher": "IANA" + }, "WEBTRANSPORT-HTTP3": { "authors": ["V. Vasiliev"], "href": "https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3", From 9f68cb45d3a69f91e118b6c5d46a52d014989de6 Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Mon, 5 May 2025 12:41:43 -0600 Subject: [PATCH 21/21] update 1. remove internal reference because the external one is merged. 2. replace "unknown" with "_". --- fetch.bs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fetch.bs b/fetch.bs index 6fccf27cf..80465fcdf 100755 --- a/fetch.bs +++ b/fetch.bs @@ -100,11 +100,6 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262 "href": "https://www.kb.cert.org/vuls/id/150227", "title": "HTTP proxy default configurations allow arbitrary TCP connections." }, - "IANA-HTTP-PARAMS": { - "href": "https://www.iana.org/assignments/http-parameters/http-parameters.xhtml", - "title": "Hypertext Transfer Protocol (HTTP) Parameters", - "publisher": "IANA" - }, "WEBTRANSPORT-HTTP3": { "authors": ["V. Vasiliev"], "href": "https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3", @@ -6326,7 +6321,7 @@ optional boolean forceNewConnection (default false), run these steps:

  • Let codings be the result of extracting header list values given `Content-Encoding` and response's header list. -

  • Let filteredCoding be "unknown". +

  • Let filteredCoding be "_".

  • If codings is null, then set filteredCoding to the empty string.