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",