gpt4 book ai didi

content-security-policy - 用CSP替换X-Frame-Options

转载 作者:行者123 更新时间:2023-12-01 23:28:45 24 4
gpt4 key购买 nike

我正在从X-Frame-Options迁移到Content Security Policy,以修复点击劫持漏洞。我的应用程序过去曾在SAMEORIGIN header 中设置X-Frame-Options策略。 Content-Security-Policy中的等效选项是什么?

最佳答案

X-Frame-Options: SAMEORIGINContent-Security-Policy: frame-ancestors 'self'
MDN CSP: frame-ancestors文章有更多详细信息。

https://w3c.github.io/webappsec-csp/#frame-ancestors-and-frame-options这样说:

This directive is similar to the X-Frame-Options header that several user agents have implemented. The 'none' source expression is roughly equivalent to that header’s DENY, 'self' to SAMEORIGIN, and so on.

关于content-security-policy - 用CSP替换X-Frame-Options,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43039706/

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