【发布时间】:2017-05-29 05:46:13
【问题描述】:
在我们的网站中加载 iframe 时出现内容安全政策错误。
Iframe 正在为我们的应用程序在虚拟目录中加载一个单独的站点。该应用程序在单独的选项卡中独立打开时可以正常工作,但在父站点的 Iframe 中无法正常工作。
我们尝试在站点母版页中添加元标记<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' http://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'" />,但没有成功。
我们还在 IIS Http 响应标头中添加了 X-Frame-Options,值为“ALLOW-FROM https://virtual directory Ip Name/”,但仍然没有成功。
问题在 IE 和 chrome 中都存在。
Chrome 控制台登录:
错误截图:
【问题讨论】:
标签: asp.net .net silverlight iframe content-security-policy