Skip to content
Discussion options

You must be logged in to vote

I did some research and it appears the issue stems from node-fetch v2.x. When dealing with headers, it uses an internal object to manage the key/values. Unfortunately when returning the value via get, it returns multi-valued keys as a comma-delimited string. There is no getAll method.

https://github.com/node-fetch/node-fetch/blob/838d9713ef5e673bbd86768fd22ba98ec461ed9d/src/headers.js#L112-L121

I created a test project and when I use curl to fetch the endpoint, I see the correct headers:

HTTP/1.1 200 OK
set-cookie: foo=bar; Path=/; HttpOnly; Expires=Wed, 21 Oct 2035 07:28:00 GMT
set-cookie: test=abc; Path=/; HttpOnly; Expires=Thu, 22 Oct 2035 07:28:00 GMT
Content-Type: application/json; c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bgschiller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants