From 1b841c7d32e67d144d9d9e0a1c7471f66700633a Mon Sep 17 00:00:00 2001 From: Max Koon <22125083+k2on@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:21:54 -0400 Subject: [PATCH] feat: enable cors --- api/src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/index.ts b/api/src/index.ts index 87b9866..29deeac 100644 --- a/api/src/index.ts +++ b/api/src/index.ts @@ -10,7 +10,10 @@ const app = getHono(); app.use( "/api/*", cors({ - origin: "*", + origin: (origin) => + origin && /^https:\/\/([a-z0-9-]+\.)?koon\.us$/.test(origin) + ? origin + : "", allowMethods: ["POST", "GET", "OPTIONS"], allowHeaders: ["Content-Type", "Authorization"], credentials: true,