diff --git a/index.ts b/index.ts index b34474f..e720a2e 100644 --- a/index.ts +++ b/index.ts @@ -31,13 +31,6 @@ 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); @@ -206,8 +199,9 @@ export class ClientResponse extends Response { super(body, init); const origin = req.headers.get("Origin"); + const origins = process.env.ORIGIN!.split(","); - if (origin && ALLOWED_ORIGINS.includes(origin)) { + if (origin && origins.includes(origin)) { this.headers.set("Access-Control-Allow-Origin", origin); this.headers.set( "Access-Control-Allow-Methods", @@ -226,8 +220,9 @@ export class ClientResponse extends Response { }); const origin = req.headers.get("Origin"); + const origins = process.env.ORIGIN!.split(","); - if (origin && ALLOWED_ORIGINS.includes(origin)) { + if (origin && origins.includes(origin)) { res.headers.set("Access-Control-Allow-Origin", origin); res.headers.set( "Access-Control-Allow-Methods",