Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
fix: use cors whitelist as-is
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwigoric committed Nov 14, 2023
1 parent 483865e commit a05a12c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ if (!process.env.FRONTEND_URLS) console.warn('FRONTEND_URLS not set, allowing al
else whitelist.push(...process.env.FRONTEND_URLS.split(','))
app.use(
cors({
origin: (origin, callback) => {
whitelist.length === 0 || whitelist.includes(origin)
? callback(null, true)
: callback(new Error('Not allowed by CORS'))
},
origin: whitelist.length === 0 ? true : whitelist,
optionsSuccessStatus: 200
})
)
Expand Down

0 comments on commit a05a12c

Please sign in to comment.