浏览器中有关CSP安全标头的奇怪反馈

时间:2016-12-09 08:45:43

标签: security http-headers content-security-policy

我想将我的网站https://www.example.com排除在iframe中。唯一的例外应该是它自己(在iframe中有自己)和Google(对于Google图像搜索,图像的原始页面显示在左侧的iframe中)。

所以我将这个标题添加到我的网站:

CONTENT-SECURITY-POLICY:frame-ancestors 'self' *.example.com *.google.com *.google.de google.com google.de;

但这不符合我的计划方式。当来自显示我的页面图像的谷歌图像搜索URL时,例如http://images.google.de/imgres?imgurl=[RANDOM STUFF]

我在控制台中看到了这个(并且没有显示iframe):

Refused to display 'https://www.example.com/lalala' in a frame
because an ancestor violates the following Content Security Policy directive:
"frame-ancestors 'self' *.example.com *.google.com *.google.de google.com google.de".

某处必须有错误,但我无法找到它..

(在最新的Google Chrome和Firefox中测试)

0 个答案:

没有答案
相关问题