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

[fix] adapter-cloudflare-workers: support setting multiple values to a header #2313

Merged
merged 2 commits into from
Aug 28, 2021

Conversation

JeanJPNM
Copy link
Contributor

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpx changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

Closes #2305 by using Headers.append on headers that have multiple values.

@changeset-bot
Copy link

changeset-bot bot commented Aug 28, 2021

🦋 Changeset detected

Latest commit: 2463529

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-cloudflare-workers Patch

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

@benmccann benmccann merged commit 704c7c7 into sveltejs:master Aug 28, 2021
@JeanJPNM JeanJPNM deleted the cloudflare-multiple-header-values branch August 28, 2021 16:26
@half2me
Copy link
Contributor

half2me commented Aug 29, 2021

@JeanJPNM do you think it would be worth to check if headers is an instance of Headers and if so, just leave it as it is. Currently this breaks if headers is already a Headers object.

I only noticed this because I had a workaround in my app which returned a Headers object, and that doesn't work with the latest version now.

@JeanJPNM
Copy link
Contributor Author

That's supposed to be the original behavior, headers was supposed to be a plain object. being able to return an instance of Headers was a side effect of the implementation of adapter-cloudflare-workers.

@half2me
Copy link
Contributor

half2me commented Aug 29, 2021

@JeanJPNM okay, makes sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[cloudflare adapter] Can't set multiple cookies
3 participants