-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(miniflare): api proxy preserve multiple Set-Cookie headers #10683
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(miniflare): api proxy preserve multiple Set-Cookie headers #10683
Conversation
🦋 Changeset detectedLatest commit: 3fd1a64 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
dario-piotrowicz
left a comment
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.
Thanks! This looks fantastic to me @yuripave 🚀 🫶
The only thing missing, could you please add a changeset for this fix? 🙂
(via npx changeset at the root of the repo)
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
385e7a8 to
f88ffb7
Compare
done! |
dario-piotrowicz
left a comment
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.
@yuripave I'm really sorry for missing your earlier message, thanks for having pinged me again! 🙇
Again, looks great to me! 😄 with just one very minor final suggestion 🙂
f88ffb7 to
3fd1a64
Compare
|
Congratulations @yuripave, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cmg0ujf3u002ml804y9v0alf4 This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
* fix(miniflare): api proxy preserve multiple Set-Cookie headers * [miniflare] custom serialization for RegExp object (#9454) * feat: encode pattern when serialize RegExp object * test: check if test suites can be filtered by pattern includes non-ascii string * chore: remove unneeded comment * test: serialize RegExp object * docs: add changeset for vitest-pool-workers to describe fix --------- Co-authored-by: Calvin Tsang <yuripave@gmail.com> Co-authored-by: Enchan <enchant0130@gmail.com> Co-authored-by: Victor Berchet <victor@suumit.com>
On local service bindings, cross worker RPC will go through miniflare API proxy. Previous implementation of Headers serialization used
Object.fromEntries()which works for most cases except when there are multiple Set-Cookie headers (since objects can't have duplicate keys). This PR fixes this by serializing Headers as an array of [key, value] pairs using[...headers.entries()]instead, which preserves all header values including multiple Set-Cookie headers.