Attempt to fix a CORS issue
This commit is contained in:
parent
41c2e27f5e
commit
cf71ed823e
1 changed files with 2 additions and 1 deletions
|
@ -19,9 +19,10 @@ const server = Bun.serve({
|
||||||
// CORS route (for now, any domain has access)
|
// CORS route (for now, any domain has access)
|
||||||
if(req.method === "OPTIONS") {
|
if(req.method === "OPTIONS") {
|
||||||
const headers:any = {
|
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-Allow-Methods': 'POST, GET, OPTIONS, DELETE',
|
||||||
'Access-Control-Max-Age': '86400',
|
'Access-Control-Max-Age': '86400',
|
||||||
|
'Access-Control-Allow-Credentials': true
|
||||||
}
|
}
|
||||||
let h
|
let h
|
||||||
if (h = req.headers.get('Access-Control-Request-Headers'))
|
if (h = req.headers.get('Access-Control-Request-Headers'))
|
||||||
|
|
Loading…
Reference in a new issue