use*_*836 10 security iframe mozilla frame content-security-policy
我正在尝试将内容加载到 IFrame 中,因此我实现了 Content-Security-Policy 标头:Content-Security-Policy:frame-ancestors http://*.example.com/abc.html。
当我将标头指定为 Content-Security-Policy:frame-ancestors http://*.example.com/ 时,我可以在 iframe 上加载内容。
但是当我将标题更改为:Content-Security-Policy:frame-ancestors self http://*.example.com/abc.html。然后 iframe 上的内容第一次加载,但当我刷新网页时出现以下错误
拒绝在框架中显示“https://...”,因为祖先违反了以下内容安全策略指令:frame-ancestors self http://*.example.com/abc.html。
谁能告诉我为什么刷新页面时会出错。框架祖先还考虑完整的 url (http:// .example.com/abc.html) 还是只考虑主机名,如 http:// .example.com?
Chrome 浏览器有一个错误- 它不支持frame-ancestors指令中的路径。Safari 也存在同样的错误,并且只有 Firefox 支持此指令中的路径。
因此,您必须使用主机源frame-ancestors来代替。
对于其他指令,您可以使用路径和文件名。http://.example.com/abc.htmlhttp://.example.com
| 归档时间: |
|
| 查看次数: |
43142 次 |
| 最近记录: |