【问题标题】:How can i enable X Frame options in asp.net如何在 asp.net 中启用 X Frame 选项
【发布时间】:2021-08-05 01:28:19
【问题描述】:
<httpProtocol>  
  <customHeaders>  
    <add name="X-Frame-Options" value="ALLOW" />  
  </customHeaders>  
</httpProtocol>

我已在 web.config 文件中添加此内容,并希望允许来自 https://preview.codecanyon.net/ 的 x-frame 站点

【问题讨论】:

  • 根据 Mozilla,“ALLOW-FROM uri,这是一个过时的指令,不再适用于现代浏览器。不要使用它。...内容- Security-Policy HTTP 标头有一个 frame-ancestors 指令,您可以使用它来代替。” Mozilla on X-Frame-Options

标签: c# asp.net x-frame-options


【解决方案1】:

您可以尝试以下方法。此外,您可以检查 here 了解更多详情。

<add name="X-Frame-Options" value="ALLOW-FROM http://xxx.xx" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-01
    • 2017-01-22
    • 1970-01-01
    • 2020-12-24
    • 2016-05-01
    • 1970-01-01
    • 2020-09-17
    • 2023-04-07
    相关资源
    最近更新 更多