-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: delay write cookie headers to first write #5986
Conversation
✅ Deploy Preview for qwik-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying qwik-docs with Cloudflare Pages
|
@wmertens we need to delay writing to headers until we first "write" to the client. that way any app code can run and add cookie headers before we stream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but it doesn't apply this to all integrations right?
And what about other headers, don't they have the same problem? Or is the problem specifically that you can only send one cookie header?
yes this applies to all headers. the e2e tests hang with this fix but when I run it locally it works correctly in preview-only. so there is something going on. @wmertens is there a better way to hook into this? |
I don't think there's a better way because each adapter had their own way of sending cookies. I think the e2e problem may be when there's no write and the response just closes without sending the cookies? Odd but maybe. In any case you should handle |
@PatrickJS notice that the e2e tests fail on this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
...but sadly the e2e fails. Try removing the once=false in close? Not sure that's needed or even desired |
@wmertens I'm thinking e2e is waiting for headers which is why it fails during e2e but not when running locally. maybe there's another way |
I think it's better having devs use |
Overview
fixes #5951
What is it?
Description
set headers once but allow for dev to add cookie values