summaryrefslogtreecommitdiff
path: root/index.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-22 21:38:58 -0800
committerFuwn <[email protected]>2024-01-22 21:38:58 -0800
commitd3710ef7635c6167d405df88d5d5d14c62c95221 (patch)
tree1995d21911d1e28e11177dcbe8f1a038e9e7f9fb /index.ts
parentfeat(index.ts): cors for due.moe (diff)
downloadcdn.due.moe-d3710ef7635c6167d405df88d5d5d14c62c95221.tar.xz
cdn.due.moe-d3710ef7635c6167d405df88d5d5d14c62c95221.zip
fix(index.ts): unload headers instead of setHEADmain
Diffstat (limited to 'index.ts')
-rw-r--r--index.ts13
1 files 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,
+ },
});
};