gpt4 book ai didi

internet-explorer - Internet Explorer的内容安全策略(CSP)解决方法

转载 作者:行者123 更新时间:2023-12-03 23:40:06 24 4
gpt4 key购买 nike

我们正在建立一个ASP.NET网站,并且只允许某些可以iFrame我们的网站的域名。 Internet Explorer不支持CSP。我正在设置类似
Response.AddHeader("Content-Security-Policy", "frame-ancestors mydomain1.com mydomain2.com")

每个人如何处理Internet Explorer。我读过IE支持X-Content-Security-Policy,但它没有frame-ancestors

我也通过执行以下操作删除了IIS添加的默认X-Frame-Options header

Response.Headers.Remove("X-Frame-Options")

最佳答案

Microsoft建议的解决方案如下:

内部

  • ,将domain1.com和domain2.com列入白名单
  • 嵌入iframe URL时
  • ,请在URL中添加一个指定来源的参数:iframe src =“http://example.org/frame.html?origin=http://domain1.com”
  • 在服务器上的
  • 中,检查原始值是否已列入白名单。使用它来设置X-Frame-Options:ALLOW-FROM http://domain1.com

  • 您也可以检查Referer header (如果存在)。

    关于internet-explorer - Internet Explorer的内容安全策略(CSP)解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33771399/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com