Skip to content

Commit

Permalink
origin undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
tfloxolodeiro committed Jun 27, 2023
1 parent c9f93f2 commit 94b7268
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ app.use(configMailing(transport))
var whitelist = [process.env.API_APP_ORIGIN_URL]
var corsOptions = {
origin: function (origin, callback) {
if (whitelist.indexOf(origin) !== -1) {
if (whitelist.indexOf(origin) !== -1 || !origin) {
callback(null, true)
} else {
callback(new Error(`Origin '${origin}' not allowed by CORS`))
Expand Down

0 comments on commit 94b7268

Please sign in to comment.