在我们的网站中加载Iframe时,出现内容安全策略错误。加载Iframe时内容安全策略错误
Iframe正在我们的应用程序的虚拟目录中加载单独的网站。该应用程序在单独的选项卡中独立打开时工作正常,但在父站点的Iframe中无效。
我们尝试在网站母版页中添加Meta标签<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 Response Header中增加了X-Frame-Options
,值为“ALLOW-FROM https://virtual directory Ip Name/
”,但仍然没有成功。
问题出现在IE和chrome中。
控制台登录铬:
错误截图: