I am loading an external script from chargebee.com and I am receiving this error message in console:
[Report Only] Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'nonce-VVZ+V0c=' 'self' https://maps.googleapis.com https://domain.chargebeestatic.com http://dgkxwewtzsnml.cloudfront.net/static/app-static-assets/hp/hp-4.8.5/". Either the 'unsafe-inline' keyword, a hash ('sjZUY='), or a nonce ('nonce-...') is required to enable inline execution.
My content security policy defined in Nginx is:
add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always;
Since I have specified 'unsafe-inline', I am not sure why this error pops up.
Update:
I can see when I click on iframe connector in Safari Console:
<!DOCTYPE>
<html>
<head>
<title></title>
<script nonce="Au5oDesccjEDNeeHfk=" >window.cb_hp_cdn_path="//dgkxetzsnml.cloudfront.net/static/app-static-assets/hp/hp-4.8.5/"</script>
</head>
<body>
</body>
<script src="https://domain.chargebeestatic.com/api/internal/15346543/retrieve_init_info" nonce="Au5oejEDNGKHHfk=" ></script>
<script type='text/javascript' src='//dgkxwewtzsnml.cloudfront.net/static/app-static-assets/hp/hp-4.8.5/javascripts/vendor.js'></script>
<script type='text/javascript' src='//dgkxwewtzsnml.cloudfront.net/static/app-static-assets/hp/hp-4.8.5/javascripts/hp_connector.js'></script>
</html>
<meta http-equiv="Content-Security-Policy" content="…'">element. Because either some other part the backend is already setting a Content-Security-Policy header, or the document itself is — and the policy getting set includesscript-src 'nonce-VVZ+V0c=' 'self' https://maps.googleapis.com https://domain.chargebeestatic.com http://dgkxwewtzsnml.cloudfront.net/static/app-static-assets/hp/hp-4.8.5/". - sideshowbarker