From a00761414a5e328f277c609e44e552f73be90fea Mon Sep 17 00:00:00 2001 From: Guohui Deng Date: Tue, 21 Jan 2025 16:22:32 -0700 Subject: [PATCH] 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.