Skip to content

Commit

Permalink
cors fix
Browse files Browse the repository at this point in the history
  • Loading branch information
imaksp committed Feb 15, 2024
1 parent 2b9b78d commit fa107a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/strapi/lib/middlewares/cors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fa107a9

Please sign in to comment.