【发布时间】:2022-01-21 22:42:09
【问题描述】:
我对 CSP 报告数据有疑问(Content-Security-Policy-Report-Only)。
-
在报告中,我只获得了根域 https://******.com。但我期待完整的路径。
-
Referrer 始终为空,但我需要获取此数据。
例如:<iframe src="https://*******.com/en/login" width="800" height="800" title="Test Frame"></iframe>。
有人可以帮我解决这个问题吗?
Header: 'Content-Security-Policy-Report-Only: frame-ancestors 'self';报告-uri https://******.com/api/security-report'
{
"csp-report": {
"document-uri": "https://******.com/",
"referrer": "",
"violated-directive": "frame-ancestors",
"effective-directive": "frame-ancestors",
"original-policy": "frame-ancestors 'self'; report-uri https://******.com/api/security-report",
"disposition": "report",
"blocked-uri": "https://******.com/",
"status-code": 200,
"script-sample": ""
}
}
【问题讨论】:
-
您是将 CSP 标头放入 iframe 还是页面本身,还是两者都放入?
-
所有主流浏览器都会出现这种情况吗?
标签: php http http-headers content-security-policy