I run a WordPress website and recently configured a CDN using CloudFront.
Most of the features are working fine, but I'm experiencing CORS issues with JS files I'm loading from Github.
I have tried many methods to resolve this issue, but I still get the following error.
Ensure CORS response header values are valid
A cross-origin resource sharing (CORS) request was blocked because of invalid or missing response headers of the request or the associated preflight request .
To fix this issue, ensure the response to the CORS request and/or the associated preflight request are not missing headers and use valid header values.
Note that if an opaque response is sufficient, the request's mode can be set to no-cors to fetch the resource with CORS disabled; that way CORS headers are not required but the response content is inaccessible (opaque).
This is my setting on Cloudfront -> https://imgsh.net/a/5GFcr4m.jpg
Access-Control-Allow-Credentials
false
Access-Control-Allow-Headers
Access-Control-Allow-Methods
GET
HEAD
PUT
POST
PATCH
DELETE
OPTIONS
Access-Control-Allow-Origin
*
Access-Control-Expose-Headers
*
Access-Control-Max-Age (seconds)
Can someone please advise me on how to resolve this issue?