73
rated 0 times
[
77]
[
4]
/ answers: 1 / hits: 10118
/ 2 Years ago, mon, march 7, 2022, 12:00:00
I'm using strapi 4 as localhost and got a problem with cors settings when I add new assets via url
Image upload takes CORS error Access to XMLHttpRequest at 'https://www.countrysideveterinaryclinic.org/sites/default/files/interesting-cat-facts.jpg' from origin 'http://localhost:1337' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Solution from here didn't help
my middleware.js
module.exports = [
'strapi::errors',
'strapi::security',
'strapi::poweredBy',
{
name: 'strapi::cors',
config: {
enabled: true,
header: '*',
origin: ['http://localhost:1337']
}
},
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::session',
'strapi::favicon',
'strapi::public',
];
More From » cors