Wie behebe ich CORS-Probleme im Cloudfront CDN?

Wie behebe ich CORS-Probleme im Cloudfront CDN?

Ich betreibe eine WordPress-Website und habe vor Kurzem ein CDN mit CloudFront konfiguriert.

Die meisten Funktionen funktionieren einwandfrei, aber ich habe CORS-Probleme mit JS-Dateien, die ich von Github lade.

Ich habe viele Methoden ausprobiert, um dieses Problem zu beheben, erhalte jedoch immer noch die folgende Fehlermeldung.

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).

Dies ist meine Einstellung auf 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)

Kann mir bitte jemand einen Rat geben, wie ich dieses Problem lösen kann?

verwandte Informationen