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

Additional headers are lost with a server-side fetch #3009

Closed
1 of 2 tasks
illright opened this issue Dec 8, 2021 · 1 comment
Closed
1 of 2 tasks

Additional headers are lost with a server-side fetch #3009

illright opened this issue Dec 8, 2021 · 1 comment

Comments

@illright
Copy link
Contributor

illright commented Dec 8, 2021

Describe the bug

When a server-side load function makes a request to the same hostname (not necessarily the same domain) and includes additional headers with the Headers object instead of a regular object, these additional headers are replaced with a Cookie header.

There are two issues to address:

  • Overwritten headers if they are passed as a Headers object
  • Incorrect detection of similar hostnames (ports aren't considered)

Reproduction

https://github.com/illright/sveltekit-repro-headers-class

Logs

N/A

System Info

System:
    OS: Linux 5.10 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
    Memory: 3.32 GB / 3.76 GB
    Container: Yes
    Shell: 3.3.1 - /bin/fish
  Binaries:
    Node: 17.1.0 - /usr/sbin/node
    npm: 8.1.3 - /usr/sbin/npm
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.3
    @sveltejs/kit: next => 1.0.0-next.201
    svelte: ^3.44.0 => 3.44.2

Severity

blocking all usage of SvelteKit

Additional Information

No response

@illright
Copy link
Contributor Author

Actually, it seems like the ports should not be considered, according to RFC 6265:

Similarly, cookies for a given host are shared
across all the ports on that host, even though the usual "same-origin
policy" used by web browsers isolates content retrieved via different
ports.

That must mean this issue can be closed.

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

No branches or pull requests

1 participant