diff --git a/src/index.ts b/src/index.ts index 70ba580..593aca5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,9 +19,10 @@ const server = Bun.serve({ // CORS route (for now, any domain has access) if(req.method === "OPTIONS") { const headers:any = { - 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Origin': req.headers.get('Origin') || '*', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, DELETE', 'Access-Control-Max-Age': '86400', + 'Access-Control-Allow-Credentials': true } let h if (h = req.headers.get('Access-Control-Request-Headers'))