You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Timing of copying cookies during server-side fetch #17486
Currently, incoming request cookies during an SSR'd request are not copied into an outgoing API request until inside the fetch that's passed to handleFetch. They are not already present on the request passed to handleFetch, and, if handleFetch changes the URL of the request, whether they are added during the (inner) fetch depends on the new changed hostname.
There are situations where this is undesirable. Consider, for example, the something else is serving both a SvelteKit app and an external API at the same origin, routing incoming requests as appropriate. Requests made from the browser can just be made same-origin as normal. Requests during SSR need to be rewritten to point to the API server on the internal network. But, doing this during handleFetch results in the expected cookies not being copied, since by the time the inner fetch sees the request, the hostname no longer matches that of the incoming request.
We should decide what we want to do about this. Changing the behavior would be a breaking change, unfortunately.
Activity