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(cookieParser());
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: function (origin, callback) {
|
origin: function (origin, callback) {
|
||||||
if (config.corsAllowList.indexOf(origin) !== -1) {
|
if (config.corsAllowList.indexOf(origin) !== -1 || !origin) {
|
||||||
callback(null, true);
|
callback(null, true);
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('Not allowed by CORS'));
|
callback(new Error('Not allowed by CORS'));
|
||||||
|
|
Reference in a new issue