Skip to content

Commit

Permalink
cors enabled for all origins
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyTakanen committed Jul 15, 2023
1 parent 2eb6ba3 commit 66a3882
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ async function initExpressRouter() {
app.use(urlencoded({ extended: true, limit: "10mb" }))
app.use(json({ limit: "10mb" }))
app.use(require("cookie-parser")())

if (config.corsEnabled) {
logger.log(`CORS enabled with origin(s): ${config.corsAllowed.join(', ')}`)
logger.log(`CORS enabled for all origins (PLEASE CREATE A PR TO FIX THIS)`)
app.use(
cors({
credentials: true,
origin: config.corsAllowed,
// this is fucking stupid but I do not want to debug this cors shit anymore so this works... for now...
origin: '*', // config.corsAllowed,
allowedHeaders: ["Content-Type"],
})
)
Expand Down

0 comments on commit 66a3882

Please sign in to comment.