-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure multiple cookies set in dev result in multiple set-cookie head…
…ers (#6973) * Ensure multiple cookies set in dev result in multiple set-cookie headers * Adding a changeset * Try connecting to localhost instead * use localhost in the Host header * Use 0.0.0.0 * localhost it is
- Loading branch information
Showing
4 changed files
with
45 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Ensure multiple cookies set in dev result in multiple set-cookie headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
packages/astro/test/fixtures/ssr-api-route/src/pages/login.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
|
||
export function post() { | ||
const headers = new Headers(); | ||
headers.append('Set-Cookie', `foo=foo; HttpOnly`); | ||
headers.append('Set-Cookie', `bar=bar; HttpOnly`); | ||
|
||
/** @type {import('astro').APIRoute} */ | ||
export function post({ cookies }) { | ||
cookies.set('foo', 'foo', { | ||
httpOnly: true | ||
}); | ||
cookies.set('bar', 'bar', { | ||
httpOnly: true | ||
}); | ||
return new Response('', { | ||
status: 201, | ||
headers, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters