首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >指定任何域时出现“无法识别的Content-Security-Policy指令”错误

指定任何域时出现“无法识别的Content-Security-Policy指令”错误
EN

Stack Overflow用户
提问于 2015-07-28 20:45:06
回答 1查看 43.6K关注 0票数 7

我已经阅读了Content Security Policy docs,并且有我的图像源的条目。我的值与文档中的示例相匹配,但Chrome报告该值无效:

代码语言:javascript
复制
Unrecognized Content-Security-Policy directive 'pbs.twimg.com'.
Unrecognized Content-Security-Policy directive 'https://pbs.twimg.com'.

报头是:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-28 21:01:57

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

票数 17
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31676720

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档