iframe - 在 IE11 上的 ms-word 插件中获取“HTTPS 安全性受到威胁”
问题描述
正如标题所述,我在使用 iframe 显示我的页面时遇到问题x-frame-options: sameorigin
看着可能的解决方案,我遇到了x-frame-options: allow-from url
,这没有任何区别。我的所有资源也通过 https 提供。当同时使用x-frame-options: sameorigin
和X-Frame-Options: allow-from url
时,sameorigin 标头被禁用。
此外,在此处x-frame-options
找到的文档:
# ALLOW-FROM uri
This is an obsolete directive that no longer works in modern browsers. Don't use it. In
supporting legacy browsers, a page can be displayed in a frame only on the specified origin
uri. Note that in the legacy Firefox implementation this still suffered from the same problem
as SAMEORIGIN did — it doesn't check the frame ancestors to see if they are in the same origin.
The Content-Security-Policy HTTP header has a frame-ancestors directive which you can use
instead.
我目前已经为其他浏览器的支持实现了上述frame-ancestors
功能,例如。Chrome、Safari 或 Firefox,但 IE11 不支持。这是一个安全层,我不想删除它以避免点击劫持。
有什么建议吗?
解决方案
如问题中所述,我发现在附加另一个x-frame-options
标头时,sameorigin
已禁用。
所以我稍微修改了标题,发现以下内容对 IE11 非常有效,并且不影响其他浏览器:
res.set("X-Frame-Options", "SAMEORIGIN, ALLOW-FROM url");
推荐阅读
- c++ - 为什么在 Qt 中创建主窗口之前必须加载语言包?
- session - 关于自由的 ViewExpiredException
- java - ArrayList 打印位置而不是输入值
- java - 解析 JSON 以映射到数组
- c# - Telerik Form 作为对话框运行有时会卡住
- java - 错误 404:无法在 JSP 中加载 css 页面
- javascript - 使用 ECMAScript 解构访问对象中的所有元素
- php - PHP + 生成 .html 文件供下载
- vba - VBA从一个excel表复制到另一个excel表?
- playframework-2.6 - 为什么我没有看到任何访问控制标头