diff --git a/packages/strapi/lib/middlewares/cors/index.js b/packages/strapi/lib/middlewares/cors/index.js index 893dd9a5..26dc1d8e 100644 --- a/packages/strapi/lib/middlewares/cors/index.js +++ b/packages/strapi/lib/middlewares/cors/index.js @@ -41,7 +41,7 @@ module.exports = (strapi) => { return '*'; } - if (!whitelist.includes(requestOrigin)) { + if (requestOrigin && !whitelist.includes(requestOrigin)) { return ctx.throw(`${requestOrigin} is not a valid origin`); } return requestOrigin;