Why does Font Awesome Kit code script cause a CORS error?

Viewed 1280

I've recently tried using font awesome 5 and used the kit code approach to add the icons on my web page.

I added the script to the head tag like below

<head>
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
</head>

This is fine and working on my local environment, but as soon as the code was deployed to a test environment, a console error occurs.

Access to script at 'https://kit.fontawesome.com/.js' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I tried removing crossorigin="anonymous" attribute from the script, but was only greeted by a 403 error. What could be the problem for this to happen?

I tried looking for a fix but most of what I found was to add access from the requested resource, which is not an option since I don't own font awesome.

0 Answers
Related