Refused to load the font ''data:font/woff;base64,...." in Ionic Framweork

1k Views Asked by At

I'm getting this error in the console:

Refused to load the font 'data:font/woff;base64,d09GRgABAAAAAGVUABEAAAAAxuQAAQABAAAAAAAAAAAAAAAAAAAAA…eLo4GBkcWhIzkkAqQkEggceHw5HFkM2VRZJFlYebR2MP5v3cDSu5GJwWUDW9xG1hQXAFAmKZU=' because it violates the following Content Security Policy directive: "font-src *".

My Content-Security-Policy meta tag looks like this:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; font-src *; script-src * 'unsafe-inline' 'unsafe-eval'; child-src *">

What would be the issue?

1

There are 1 best solutions below

0
On

Star isn't quite the wildcard you'd think it is in Content Security Policy. You have to manually specify certain directives including data: and blob:. Star will match any domain but not any protocol.

Adding data: to font-src list will let the font load. (Additionally I would remove the asterisk to trust as few things as possible).