-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
responseHeaders['set-cookie'] better stores in an array? #1616
Comments
This is how the fetch spec defines the behavior and is not something I believe we can change. |
See wintercg/fetch#7. |
@ronag Are you referring to the Fetch Standard? https://fetch.spec.whatwg.org/#headers-class Anyway, glad to hear if we can move on one day. @mcollina Thx & B/R |
undici/lib/fetch/index.js
Line 1952 in 6a87bfb
When it comes to response headers: 'set-cookie', the value stores as a string as well.
The problem is that there may be multiple 'set-cookie' headers in various of formats sent from the server.
Hard to split when joined in a string. (Or, do you have any better ideas defining the splitter? Coz I am a newbie)
It would be easier to handle as an array.
Reasons/References are as follows:
In older ways, it stores as an array. Quotes: set-cookie is always an array. Duplicates are added to the array.
https://nodejs.org/api/http.html#messageheaders
And node-fetch package implemented this way as well, which you may have referred.
https://github.com/node-fetch/node-fetch/blob/main/src/index.js#L65
Thx & B/R
Fred
The text was updated successfully, but these errors were encountered: