Re: [whatwg/fetch] Use case for Headers getAll (#973)

For future reference, this is how we solve this in Deno's fetch implementation:

1. Setting `Set-Cookie` headers does not concatenate headers, it will keep them seperate (both in the internal data structure, and on the wire)
2. `h.get("Set-Cookie")` returns a concatentated list of `Set-Cookie` headers.
3. Iterating over `h` (or using `h.entries`, `h.values`, or `h.keys`) will result concatentated headers, as specified **except for `set-cookie` headers**. These are returned as is, without concatenation. That means it is possible that `h.entries` returns multiple items where the header name is `set-cookie`.

This was the solution of us trying to come up with a solution for multiple years. We deem this breaks the least existing code, while also being relatively easy to understand and use.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/973#issuecomment-902578584

Received on Friday, 20 August 2021 09:55:52 UTC