diff options
| author | Fuwn <[email protected]> | 2024-01-22 21:38:58 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-22 21:38:58 -0800 |
| commit | d3710ef7635c6167d405df88d5d5d14c62c95221 (patch) | |
| tree | 1995d21911d1e28e11177dcbe8f1a038e9e7f9fb /index.ts | |
| parent | feat(index.ts): cors for due.moe (diff) | |
| download | cdn.due.moe-main.tar.xz cdn.due.moe-main.zip | |
Diffstat (limited to 'index.ts')
| -rw-r--r-- | index.ts | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -99,15 +99,14 @@ const handleRequest = async (originalRequest) => { // ); // } - response.headers.set( - "cache-control", - "public, immutable, s-maxage=31536000, max-age=31536000, stale-while-revalidate=60" - ); - response.headers.set("Access-Control-Allow-Origin", "https://due.moe"); - return new Response(response.body, { status: response.status, statusText: response.statusText, - headers: response.headers, + headers: { + "Cache-Control": + "public, immutable, s-maxage=31536000, max-age=31536000, stale-while-revalidate=60", + "Access-Control-Allow-Origin": "https://due.moe", + ...response.headers, + }, }); }; |