Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refused to load the font 'data:font/wof' because it violates the following Content Security Policy directive: "font-src 'self' https://fonts.gstatic.com". #7937

Closed
MukeshJitSinghBaidwan opened this issue May 9, 2024 · 3 comments
Labels

Comments

@MukeshJitSinghBaidwan
Copy link

The ag grid wont load properly. All the icons come up as blank squares. This is happening due to the CSP that wont allow the font to be loaded from data: .

It throws the error
Refused to load the font 'data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABGYAAsAAAAAJUAAABFHAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIh2BmAAixwKpXCfGwE2AiQDgiwLgRgABCAFhEYHhRYbjiBFIbBxQJhBP8IiqifF7P9DAp1DWLRF/YtGkJpOTafDolO66hq923HLpBjtKhEisuawXiIEoOjQaGO9OOdNmM/k7y5DCZMHau317e0FCManAAiSyCaunoRkkLFl1/9/c+VPMsnNEtBMGFedLLAjUjWiUlf3+d7r9jXZ9QR298S0qL4ULfAzmTVNTp0mtPCuUzXkB9rmv+OwOMJMsBBtenrY+GctjprYgZGc8X+zSHSRfcvw1zpZ98C2kVXG2W5VN1e6FQaG8JwEf+HchRXcb/Z2hfQ8dNS65LeVddel9vIEBkLLAG+YnEKJNWojAGE6V6EkgmyIn4SZ/+fnUtsboqwa/IGs0PNzOvCvzXv/pcBZSp...3g2DCqxCIR5uJZqyIJPoZ4J5LY+gKUazY6BSu5tYrnZWTNhtLC560Aq5pu1Hxm2ADhCAgVDfnVHfDFWv3a/K+boiQrqqYbpmU7rucHYRQnaZYXZVU3bdcP4zQv67Yf53U/r/fn6869B4+ePHvx6s27D59rb8W2BFayi6GUQ3HMm/KqUkVQ4IU6kvi4naC+2zjVWTroy40OXNDAQOiCZDjdldAHKfe+ah+pTq7Sk7buUo8h76oOTFIx6EJ1moWamPOmukOhMysBX7vadsckqTmo3oEf6uxl7jbzzNKUb00TU5syF3ZcEjsz9qnYqzHsabj0FTo92y3fUrtgtzEmh26BAjP024Pka2cbcuIidIC90FxL7+MIWiQNZwmbqYJINUTeTgODi30+piO9mVi3PXMMdTTmaKOpIKhsx0WOAXbzc19S6ziGQukT7aE2oe1becDAJ2Ubp0wARhQ7m5VjgrDdv2N5JuuSRQBzomCUKV7nW2tS/6FeMhsYy1oDAA==' because it violates the following Content Security Policy directive: "font-src 'self' https://fonts.gstatic.com".

Is there any alternative to load fonts ?

Many thanks.

Versions:
"ag-grid-angular-legacy": "28.0.0",
"ag-grid-community": "28.0.0",

@AG-Zoheil
Copy link

Hi

Thank you for reporting this.

We'd be happy to look into this, but the most efficient way for us to do so would be for you to provide a live example reproducing the issue.

Please send us a live plunker sample which shows the issue. You can use one of the examples from our website as a starting point. Do let us know if you need further guidance on this.

We're looking forward to your response.

Kind regards,
Zoheil

@MukeshJitSinghBaidwan
Copy link
Author

It is not possible for me to provide a live example as it is working on my local machine and will only replicate on my test env that has CSP applied in the apache conf.
My question is if the CSP does not allow data: as a font-src then what are my options to load the fonts/icons for ag grid?

@AG-Zoheil
Copy link

Hi @MukeshJitSinghBaidwan,

Thanks. We would struggle to look into this without a reproducible scenario. However I've linked your issue to item AG-2692 in our backlog which is a generic task for us to investigate the implications of inlining styling/images in AG Grid.

Furthermore, there is this thread on stackoverflow which might be useful to you: https://stackoverflow.com/questions/45366744/refused-to-load-the-font-datafont-woff-it-violates-the-following-content.

I hope this helps.

Kind regards,
Zoheil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants