Closed triblondon closed 2 years ago
This HTTP request returns a response with multiple headers that have the same name:
$ curl -i "https://httpbin.org/response-headers?Foo=42&Foo=43&Foo=45" HTTP/2 200 date: Thu, 15 Oct 2020 12:58:56 GMT content-type: application/json content-length: 117 server: gunicorn/19.9.0 foo: 42 foo: 43 foo: 45 access-control-allow-origin: * access-control-allow-credentials: true ...body...
However, the response returned by fetch-h2 combines these values into a comma-delimited string:
response
fetch-h2
for (const h of response.headers.entries()) { if (h[0] === 'foo') console.log(h); }
Outputs:
[ 'foo', '42, 43, 45' ]
When I would expect:
[ 'foo', ['42', '43', '45' ]]
This seems to be a NodeJS issue, and I've raised https://github.com/nodejs/node/issues/35658 over there.
I agree this could be useful, but as you write, this is from the node core itself, and not something fetch-h2 can mitigate, so closing
This HTTP request returns a response with multiple headers that have the same name:
However, the
response
returned byfetch-h2
combines these values into a comma-delimited string:Outputs:
When I would expect:
This seems to be a NodeJS issue, and I've raised https://github.com/nodejs/node/issues/35658 over there.