Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Unrecognized Content-Security-Policy directive' error when specifying any domain

I've read the Content Security Policy docs and have entries for my image sources. My values match the examples in the docs, but Chrome complains the valus aren't valid:

Unrecognized Content-Security-Policy directive 'pbs.twimg.com'.
Unrecognized Content-Security-Policy directive 'https://pbs.twimg.com'.

The header is:

Content-Security-Policy-Report-Only:default-src 'self' 'unsafe-inline' 'unsafe-eval' mycompany.com *.typekit.net *.stripe.com *.mxpnl.com *.twitter.com;img-src 'self' data:; pbs.twimg.com;font-src fonts.googleapis.com fonts.gstatic.com *.typekit.net;report-uri /csp-violation
like image 463
mikemaccana Avatar asked Jul 28 '15 12:07

mikemaccana


1 Answers

You have a semi-colon after data: and before pbs.twimg.com so pbs.twimg.com is being treated as a directive-name instead of as part of a directive-value.

like image 106
Quentin Avatar answered Dec 29 '22 03:12

Quentin