Skip to content

Commit

Permalink
fix #1637 forwarding request cookies on single flight mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Oct 31, 2024
1 parent 0060b3b commit 708a7a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quick-bananas-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

forward request cookies on single flight mutations
3 changes: 2 additions & 1 deletion packages/start/src/runtime/server-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@ async function handleSingleFlight(sourceEvent: FetchEvent, result: any): Promise
new URL(sourceEvent.request.url).origin + import.meta.env.SERVER_BASE_URL
).toString();
}
const cookies = sourceEvent.request.headers.get("cookie");
const event = cloneEvent(sourceEvent) as PageEvent;
event.request = new Request(url);
event.request = new Request(url, cookies ? { headers: { cookie: cookies } } : undefined);
return await provideRequestEvent(event, async () => {
await createPageEvent(event);
/* @ts-ignore */
Expand Down

0 comments on commit 708a7a1

Please sign in to comment.