Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content Security Policy: The page’s settings blocked the loading of a resource at data:image/svg+xml;base64,PHN2ZyB3aWR0aD… (“default-src”)

I am trying to add a paypal button, but the image doesnt load and gives the below error

Content Security Policy: The page’s settings blocked the loading of a resource at data:image/svg+xml;base64,PHN2ZyB3aWR0aD… (“default-src”)

Below is my meta code

<meta http-equiv="Content-Security-Policy" content="default-src * 'data'; img-src: *; style-src 'self' 'unsafe-inline' https://* http://*; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://* http://*" />

I have many external scripts/css/images which are loaded and i want allow everything to load without getting blocked.

Any help will be appreciated

like image 464
LiveEn Avatar asked Oct 14 '25 04:10

LiveEn


1 Answers

You have defined img-src with just * which will include everything HTTP or HTTPS depending on your connection. 'data' will not be included. You will need to include data: (with the colon but without quotes) to img-src. You have included 'data' in default-src, but as you have defined img-src this fallback will not be used. Also check your syntax as pointed out by @sideshowbarker.

like image 151
Halvor Sakshaug Avatar answered Oct 17 '25 18:10

Halvor Sakshaug



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!