-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cannot set set-cookie response headers multiple times #6032
Comments
|
If this is referring to the |
You are right, then it's a bug 😄 |
My bad, set-cookie is indeed handled as a special case correctly if I pass in an array like the doc says, leading in multiple set-cookie being set. Sorry for the annoyance. |
It's good that the array version is working, but the docs do say that you should be able to call it multiple times as well. Reopening. |
As far as I am concerned, not being able to call it multiple times is not an issue (I prefer the array version), and we could just fix the doc :) But it's not my call to decide. Thanks anyway for your very prompt feedback. |
* [fix] handle set-cookie in setHeaders Fixes #6032 * Update packages/kit/src/runtime/server/index.js Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> * Update packages/kit/src/runtime/server/index.js * separate out cookie handling more explicitly Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Rich Harris <richard.a.harris@gmail.com> Co-authored-by: Rich Harris <hello@rich-harris.dev>
Describe the bug
Since the
setHeaders
takes a POJO and also checks that a response header as not been already set, one cannot set multiple cookies with multipleset-cookie
headers.Reproduction
Source code for
setHeaders
checks whether an header is already been set, so can’t even call it multiple times.Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: