-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Unable to set more than 1 cookie when using redirect() #637
Comments
@SaltyAom, the main cause is that this function returns a Line 68 in 968650b
Lines 152 to 153 in 968650b
which cannot be used in such a spreading operation: Line 201 in 968650b
Is this parsing step even needed? |
In addition to redirecting, this bug also occurs when returning raw import { Elysia } from "elysia";
new Elysia()
.get("/", () => "yay")
.get("/redirect", ({ cookie: { name, name2 }, set }) => {
name.value = 'value'
name2.value = 'value2'
return new Response('yay')
})
.listen(8080); |
Fixed on a4d74d5, published on 1.0.19 |
I checked the solution to my problem + #637 (comment), it's ok, thanks |
What version of Elysia.JS is running?
^1.0.18
What platform is your computer?
Darwin 23.4.0 arm64 arm
What steps can reproduce the bug?
If you set more than 1 cookie, it will not be set.
What is the expected behavior?
>1 cookies must be successfully set when redirect() is used
What do you see instead?
This is what the server headers look like when 1 or 2 cookies are set
Additional information
UPD: It turns out that if you use
set.redirect
, there are no problems.The text was updated successfully, but these errors were encountered: