Attempt to fix a CORS issue

This commit is contained in:
Gordon Pedersen 2023-10-17 11:19:29 +11:00
parent 41c2e27f5e
commit cf71ed823e

View file

@ -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'))