fontawesome blocked by CORS policy

2.7k views Asked by At

I am getting the following error when I am using fontawesome and the icons do not appear. Anyone know what this issue is?

Access to Font at 'http://localhost/sites/all/libraries/fontawesome/fonts/fontawesome-webfont.woff2?v=4.6.3' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

1

There are 1 answers

0
Michael Kang On

This is a CORS issue - cross-origin (domain) requests are normally blocked by browsers a security measure. An origin is different if the protocol, domain, or port is different.

If you are using .NET Core, you can by enable CORS through middleware components. There CORS alternatives for ASP.NET Web API as well.