Update CORS to allow GitHub.dev origins
This commit is contained in:
@ -35,12 +35,14 @@ function isAllowedOrigin(origin) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const host = new URL(origin).hostname
|
const host = new URL(origin).hostname
|
||||||
if (host.endsWith('.vercel.app')) return true
|
return (
|
||||||
|
host.endsWith('.vercel.app') ||
|
||||||
|
host.endsWith('.app.github.dev')
|
||||||
|
)
|
||||||
} catch {
|
} catch {
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const corsOptions = {
|
const corsOptions = {
|
||||||
origin: (origin, cb) => {
|
origin: (origin, cb) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user