allow requests without origin header to api domain
This commit is contained in:
parent
2f28d606e0
commit
45a4a50812
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -19,7 +19,7 @@ app.use(express.json());
|
|||
app.use(cookieParser());
|
||||
app.use(cors({
|
||||
origin: function (origin, callback) {
|
||||
if (config.corsAllowList.indexOf(origin) !== -1) {
|
||||
if (config.corsAllowList.indexOf(origin) !== -1 || !origin) {
|
||||
callback(null, true);
|
||||
} else {
|
||||
callback(new Error('Not allowed by CORS'));
|
||||
|
|
Reference in a new issue