Hi,
I got CORS issue on my project:
Access to script at 'hxxps://app.clickcraft.hu/assets/js/craft/craft.js' from origin 'hxxps://www.diamondnails.hu' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
my cors config is:
'paths' => ['*'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => ['*'],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'supportedContentTypes' => [
'application/json',
'text/html',
'text/plain',
'application/javascript',
'application/x-javascript',
'text/javascript',
'text/css'
],
'max_age' => 0,
'supports_credentials' => false,
But not working.
I also tried to modify the public/.htaccess:
<IfModule mod_headers.c> <FilesMatch "\.(js|css|bmp|cur|gif|ico|jpe?g|png|svgz?|webp|pdf|eot|otf|tt[cf]|woff2?)$"> Header set Access-Control-Allow-Origin "*" env=IS_CORS Header set Cross-Origin-Resource-Policy 'cross-origin' </FilesMatch> </IfModule>
but also not working.
Any other API requests is OK. How can I enable CORS to static assets?