From d3710ef7635c6167d405df88d5d5d14c62c95221 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 22 Jan 2024 21:38:58 -0800 Subject: fix(index.ts): unload headers instead of set --- index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.ts b/index.ts index f78af6a..55c5125 100644 --- a/index.ts +++ b/index.ts @@ -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, + }, }); }; -- cgit v1.2.3