From 7f50b503cfc6248ae5172aad0dc8bbb0ab33f34b Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 6 May 2025 10:16:17 +0200 Subject: [PATCH] Allowlist play.ty.dev (#17857) --- playground/api/src/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/playground/api/src/index.ts b/playground/api/src/index.ts index d75c8135f2..9ac1ff5a97 100644 --- a/playground/api/src/index.ts +++ b/playground/api/src/index.ts @@ -31,7 +31,11 @@ const PRODUCTION_HEADERS = { "Access-Control-Allow-Origin": "https://play.ruff.rs", }; -const ALLOWED_DOMAINS = ["https://playknot.ruff.rs", "https://types.ruff.rs"]; +const ALLOWED_DOMAINS = new Set([ + "https://playknot.ruff.rs", + "https://types.ruff.rs", + "https://play.ty.dev", +]); export default { async fetch( @@ -45,7 +49,7 @@ export default { if (!DEV) { const origin = request.headers.get("origin"); - if (origin && ALLOWED_DOMAINS.includes(origin)) { + if (origin && ALLOWED_DOMAINS.has(origin)) { headers["Access-Control-Allow-Origin"] = origin; } }