Content Security Policy
-
First of all, thanks for a great plugin.
I am using Content-Security-Policy-Report-Only ( http://www.w3.org/TR/CSP11/ ) on my site which uses Piwik 2.5 and WP-Piwik and I get violations flagged in the Chrome Console Panel for the inlined Piwik tracking script.
<!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u=(("https:" == document.location.protocol) ? "https" : "http") + "://www.mypiwik.mydomain.com/"; _paq.push(['setTrackerUrl', u+'js/']); _paq.push(['setSiteId', 1]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'js/'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code -->Here is my htaccess rule…
Header set Content-Security-Policy-Report-Only "default-src 'none'; \ style-src 'self'; \ font-src 'self'; \ img-src 'self' http://www.mypiwik.mydomain.com; \ script-src 'self' http://www.mypiwik.mydomain.com ajax.googleapis.com"I believe that the violation can be removed in a few ways – adding a hash, nonce, or loading the script from a file in a approved (in the CSP rule) domain. (‘unsafe-inline’ is not a safe option).
Is there anything you can do in WP-Piwik to remove these violations.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Content Security Policy’ is closed to new replies.