'Unrecognized Content-Security-Policy directive' 指定任何域时出错

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

我已阅读 Content Security Policy docs 并获得了我的图片来源条目。我的值与文档中的示例相匹配,但 Chrome 抱怨值无效:

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

header是:

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

您在 data: 之后和 pbs.twimg.com 之前有一个分号,因此 pbs.twimg.com 被视为 指令名称 而不是作为 指令值 .

的一部分