0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

fix(vercel): make Astro.cookies work again (#9809)

* addCookieHeaders

* add changeset
This commit is contained in:
Arsh 2024-01-24 17:17:33 +00:00 committed by GitHub
parent 0f664e7a0a
commit 3435b7f1e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/vercel": patch
---
Fixes an issue where the serverless function ignored cookies added using Astro.cookies.

View file

@ -20,7 +20,7 @@ export const createExports = (manifest: SSRManifest) => {
: Array.isArray(localsHeader)
? JSON.parse(localsHeader[0])
: {};
const webResponse = await app.render(req, { locals, clientAddress });
const webResponse = await app.render(req, { addCookieHeader: true, clientAddress, locals });
await NodeApp.writeResponse(webResponse, res);
};