From 5cbb504657911bb6a6c7c98a9ebac2371a983f90 Mon Sep 17 00:00:00 2001 From: edideaur Date: Sat, 31 Jan 2026 18:55:40 +0000 Subject: [PATCH] Update index.ts --- index.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index e720a2e..b34474f 100644 --- a/index.ts +++ b/index.ts @@ -31,6 +31,13 @@ async function updateChangelistIds() { const tracker_page = "https://docs.google.com/spreadsheets/u/0/d/1Z8aANbxXbnUGoZPRvJfWL3gz6jrzPPrwVt3d0c1iJ_4/htmlview/sheet?headers=false&gid=1884837542"; + +const ALLOWED_ORIGINS = [ + "https://artistgrid.cx", + "https://monochrome.tf", + "https://monochrome-back.pages.dev", + "https://monochrome.samidy.com", +]; async function getTH() { const req = await fetch(tracker_page); @@ -199,9 +206,8 @@ export class ClientResponse extends Response { super(body, init); const origin = req.headers.get("Origin"); - const origins = process.env.ORIGIN!.split(","); - if (origin && origins.includes(origin)) { + if (origin && ALLOWED_ORIGINS.includes(origin)) { this.headers.set("Access-Control-Allow-Origin", origin); this.headers.set( "Access-Control-Allow-Methods", @@ -220,9 +226,8 @@ export class ClientResponse extends Response { }); const origin = req.headers.get("Origin"); - const origins = process.env.ORIGIN!.split(","); - if (origin && origins.includes(origin)) { + if (origin && ALLOWED_ORIGINS.includes(origin)) { res.headers.set("Access-Control-Allow-Origin", origin); res.headers.set( "Access-Control-Allow-Methods",