Cannot set multiple "Set-Cookie" response headers
See original GitHub issuePrerequisites
- I confirm my issue is not in the opened issues
- I confirm the Frequently Asked Questions didn’t contain the answer to my issue
Environment check
- I’m using the latest
msw
version - I’m using Node.js version 14 or higher
Node.js version
v16.14.0
Reproduction repository
https://codesandbox.io/s/relaxed-vaughan-fuo4gq?file=/index.js
Reproduction steps
- Open the sandbox in a new window.
- Navigate to
/
. See theset-cookie
response header in the Devtools. - Navigate to
/another
. See theset-cookie
response header in the Devtools. It’s missing a value.
Current behavior
Only the latest Set-Cookie
value is being set on the mocked response.
Expected behavior
You can set multiple Set-Cookie
response headers on a mocked response using the ctx.cookie
transformer.s
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
can no longer return multiple set-cookie headers from ... - GitHub
There should be a way to fix this server-side by using the headers.raw() method from node-fetch (which is what provides Headers on the...
Read more >Are multiple Cookie headers allowed in an HTTP request?
The spec says the server should not fold multiple Set-Cookie header fields into one field, but it can add multiple Set-Cookie header fields...
Read more >Set-Cookie - HTTP - MDN Web Docs
The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so that the user agent...
Read more >RFC 6265 - HTTP State Management Mechanism
An origin server can include multiple Set-Cookie header fields in a single response. The presence of a Cookie or a Set-Cookie header field...
Read more >setcookie - Manual - PHP
Note that the $_COOKIE variable not will hold multiple cookies with the same name. It is legitimate to set two cookies with the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great! I got caught up with work stuff and then vacation stuff 😃
Hi @kettanaito. I think I could, possibly tomorrow 😃