- From: Carlo Cannas <notifications@github.com>
- Date: Mon, 19 Aug 2024 05:53:36 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/fetch/pull/1769/c2296506917@github.com>
Hmm, what about an header with empty value? If they are allowed (which seems the case to me, reading both [RFC 9110](https://httpwg.org/specs/rfc9110.html#fields.values) and [header value definition](https://fetch.spec.whatwg.org/#header-value)) I think this algorithm should return a list of a single empty string, not an empty list. What do you think? Maybe something like this? (sorry for the bad formatting) ``` Let input be the result of isomorphic decoding value. Let position be a position variable for input, initially pointing at the start of input. Let values be a list of strings, initially empty. Let temporaryValue be the empty string. While true: Append the result of collecting a sequence of code points that are not U+0022 (") or U+002C (,) from input, given position, to temporaryValue. The result might be the empty string. If position is not past the end of input and the code point at position within input is U+0022 ("), then: Append the result of collecting an HTTP quoted string from input, given position, to temporaryValue. If position is not past the end of input, then continue. Remove all HTTP tab or space from the start and end of temporaryValue. Append temporaryValue to values. If position is past the end of input return values Set temporaryValue to the empty string. Assert: the code point at position within input is U+002C (,). Advance position by 1. ``` -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/pull/1769#issuecomment-2296506917 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/fetch/pull/1769/c2296506917@github.com>
Received on Monday, 19 August 2024 12:53:40 UTC