You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
@ronag Are you referring to the Fetch Standard? https://fetch.spec.whatwg.org/#headers-class
The following quotes could be quite informative:
Unlike a header list, a Headers object cannot represent more than one Set-Cookieheader. In a way this is problematic as unlike all other headers Set-Cookie headers cannot be combined, but since Set-Cookie headers are not exposed to client-side JavaScript this is deemed an acceptable compromise. Implementations could choose the more efficient Headers object representation even for a header list, as long as they also support an associated data structure for Set-Cookie headers.
Anyway, glad to hear if we can move on one day. @mcollina
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: