mirror of
https://github.com/strapi/strapi.git
synced 2025-09-19 13:31:34 +00:00
Change split for REGEX and return * when in array exist
This commit is contained in:
parent
d31447ad93
commit
974c748cf8
@ -34,7 +34,7 @@ module.exports = strapi => {
|
||||
origin: function(ctx) {
|
||||
const whitelist = strapi.config.middleware.settings.cors.origin.split(/\s*,\s*/);
|
||||
const requestOrigin = ctx.accept.headers.origin;
|
||||
if(whitelist.includes('*'){
|
||||
if(whitelist.includes('*')){
|
||||
return '*';
|
||||
}
|
||||
if (!whitelist.includes(requestOrigin)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user