Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 685
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
This would solve...
As outlined at WHATWG/fetch there is often the need in a server environment to access cookie headers.
For example editing Cookie headers:
consth=newHeaders;h.append("Set-Cookie","a=1; Expires=Wed, 21 Oct 2015 07:28:00 GMT");h.append("Set-Cookie","b=1; Expires=Wed, 21 Oct 2015 07:28:00 GMT");h.get("Set-Cookie")// a=1; Expires=Wed, 21 Oct 2015 07:28:00 GMT, b=1; Expires=Wed, 21 Oct 2015 07:28:00 GMTSplitting the combined header value by , will give an invalid result. Instead getAll could be used to retrieve the individual headers.
The implementation should look like...
There are two solutions currently proposed:
- Node-fetch provides a non-standard
Headers.prototype.rawmethod that returns entries for each (including duplicate) header. - Re-introduce
Headers.prototype.getAllto return multiple header values.
I have also considered...
- Not use undici primitives within NodeJS.
- Attempt to monkey patch undici
Additional context
- Cloudflare implemented .getAll().
- Node-fetch
.raw()implementation - Tracking at WinterCG
AndersDJohnson, rrakso and gbo-redspher
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request