sveltejs / kit

web development, streamlined
https://svelte.dev/docs/kit
MIT License
18.75k stars 1.95k forks source link

fix: handle empty Headers when serialising Request passed to fetch #13023

Closed eltigerchino closed 3 days ago

eltigerchino commented 4 days ago

fixes https://github.com/sveltejs/kit/issues/10474

This PR aligning the difference between the server and the client code when reconstructing the Request object passed to the fetch function. Currently, the server returns undefined if there are no headers in the request before data serialisation... https://github.com/sveltejs/kit/blob/143dbf9da9d65dedfc370160c229c317fe18361c/packages/kit/src/runtime/server/page/load_data.js#L227-L230 however, the client code simply uses an empty Headers object when building the selector used during hydration.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

Tests

Changesets

Edits

changeset-bot[bot] commented 4 days ago

🦋 Changeset detected

Latest commit: 68f8d2e362a75456381c993bfaa3ff6962e12b9d

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

This PR includes changesets to release 1 package | Name | Type | | ------------- | ----- | | @sveltejs/kit | 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

Rich-Harris commented 4 days ago

preview: https://svelte-dev-git-preview-kit-13023-svelte.vercel.app/

this is an automated message