Skip to content
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

[BUG] set-cookie twice / header folds #423

Open
1 task done
ostenbom opened this issue Dec 4, 2023 · 0 comments
Open
1 task done

[BUG] set-cookie twice / header folds #423

ostenbom opened this issue Dec 4, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@ostenbom
Copy link

ostenbom commented Dec 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What version of workers-rs are you using?

0.0.18

What version of wrangler are you using?

0.0.18

Describe the bug

When calling a cloudflare worker in workers-rs, the set-cookie header "folds" and creates a single set-cookie = cookie1=value1, cookie2=value2.

According to cloudflare docs and the IETF RFC, the set-cookie header should not fold.

We do not have the same behaviour in our javascript workers.

It's a tricky case when looking at the headers interface, but maybe a similar getAll interface is needed here?

This makes it slightly more tricky to act as a reverse-proxy and forward requests from our worker.

Steps To Reproduce

  1. Make a cf workers-rs worker
  2. Log request.headers
  3. curl -H "Set-Cookie: cookie1=value1" -H "Set-Cookie: cookie2=value2" http://0.0.0.0:8787
  4. Observe set-cookie = cookie1=value1, cookie2=value2
@kflansburg kflansburg added the good first issue Good for newcomers label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants