failing test for #696
#698
Closing issue
Fetch call made from the server should have the same headers, as the one made from the client.
<!-- index.svelte -->
<script context="module">
export async function load({ fetch }) {
const { headers } = await fetch('/content.json').then(res => res.json())
return {
props: { headers }
}
};
</script>
// content.json.ts
export const get = (request) => ({
body: {
headers: request.headers // <- headers: {} if requested during SSR, but populated otherwise
}
});
In the above case the request.headers are empty ({}) if requested during SSR, but populated when requested from the client on navigation or if requested directly.
The expected behavior is that in both cases the headers are populated and requests look the same.
envinfo:
npmPackages:
@sveltejs/adapter-node: next => 1.0.0-next.10
@sveltejs/kit: next => 1.0.0-next.60
svelte: ^3.29.0 => 3.35.0 Pull request
See #696. Not quite sure what the correct behaviour should be here
Info
This pull request is being automatically deployed with Vercel ().
To see the status of your deployment, click below or on the icon next to each commit.
š Inspect:
ā
Preview: Canceled
I'm going to go ahead and close this for now to keep the queue clean since it's not actionable, but I linked it to the issue so that we don't lose track of it
Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)