diff options
author | 2022-10-18 15:52:49 +0200 | |
---|---|---|
committer | 2022-10-18 09:52:49 -0400 | |
commit | 5923dd77c17c80747f9fe746ff8270ad4c820003 (patch) | |
tree | 23611ba030bb4d940660821efdd8a2448fc88733 /examples/ssr/src/api.ts | |
parent | 04ce7f4e5c49c16302baacbfbdec38da1bb8d4c3 (diff) | |
download | astro-5923dd77c17c80747f9fe746ff8270ad4c820003.tar.gz astro-5923dd77c17c80747f9fe746ff8270ad4c820003.tar.zst astro-5923dd77c17c80747f9fe746ff8270ad4c820003.zip |
adding cookies to api route response [simple result] (#5060)
* adding cookies to the an api route response, also when returning a simple result
* in dev server, convert a simple endpoint result into a response object
Co-authored-by: AirBorne04 <unknown>
Co-authored-by: AirBorne04 <>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Diffstat (limited to 'examples/ssr/src/api.ts')
-rw-r--r-- | examples/ssr/src/api.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/ssr/src/api.ts b/examples/ssr/src/api.ts index 32b48e220..1be1f54f0 100644 --- a/examples/ssr/src/api.ts +++ b/examples/ssr/src/api.ts @@ -28,6 +28,7 @@ async function get<T>( ): Promise<T> { const response = await fetch(`${getOrigin(incomingReq)}${endpoint}`, { credentials: 'same-origin', + headers: incomingReq.headers, }); if (!response.ok) { // TODO make this better... |