【发布时间】:2018-08-01 22:48:00
【问题描述】:
我有一个网站,我需要从它本身以及另一个 URL 加载资源。
因此,在 Apache 中,我同时添加了 SAMEORIGIN 和 ALLOW-FROM。
有趣的是,Chrome 拒绝显示该页面,指出存在多个值冲突的 X-Frame-Options 标头,然后退回到“拒绝”。另一方面,IE 运行良好!
我通过删除 SAMEORIGIN 对其进行了修改,并将我的原始站点 URL 添加到 ALLOW-FROM 中。这一次,Chrome 可以,但 IE 不行!
如果您想尝试,以下是我使用的遇到问题的设置:
# Test 1: Use these 2 lines will make IE work, but not Chrome
Header always append X-Frame-Options "SAMEORIGIN"
Header always append X-Frame-Options "ALLOW-FROM https://www.google.com"
# Test 2: Use these 2 lines will make Chrome work, but not IE
# (<MyBaseServerURL> represents the location as indicated by the "SAMEORIGIN")
Header always append X-Frame-Options "ALLOW-FROM https://www.google.com"
Header always append X-Frame-Options "ALLOW-FROM https://<MyBaseServerURL>"
有人可以建议我如何解决这个问题吗?
感谢和问候, 杰基
【问题讨论】:
-
由于缺乏答案,我在思考是否没有其他人有这个问题?或者这是无法解决的问题?我没有说清楚吗?还是……?
标签: apache google-chrome internet-explorer x-frame-options same-origin-policy