Skip to content

Commit

Permalink
feat: set smockr secret as default allowed headers
Browse files Browse the repository at this point in the history
  • Loading branch information
adeherysh authored Apr 9, 2024
1 parent 91a9dda commit ff155d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ const port = process.env.PORT || 8080
const corsOptions = cors({
origin: process.env.ALLOWED_ORIGIN,
methods: process.env.ALLOWED_METHODS,
allowedHeaders: process.env.ALLOWED_HEADERS || '*',
allowedHeaders: process.env.ALLOWED_HEADERS
? `X-Smockr-Secret,${process.env.ALLOWED_HEADERS}`
: '*',
optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
})

Expand Down

0 comments on commit ff155d5

Please sign in to comment.