我正在尝试使用Firefox的内容安全策略。基本上,它是网页的特殊头部,告诉浏览器哪些资源是有效的。
当某个资源无效因为它违反了策略时,Firefox会以JSON格式向给定的URI发送报告。
以下是典型的报告:
当某个资源无效因为它违反了策略时,Firefox会以JSON格式向给定的URI发送报告。
以下是典型的报告:
array(1) {
["csp-report"]=>
array(4) {
["request"]=>
string(71) "GET http://example.com/?function=detail&id=565 HTTP/1.1"
["request-headers"]=>
string(494) "Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0b10pre) Gecko/20110115 Firefox/4.0b10pre
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: es-ar,en-us;q=0.8,es;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
Connection: keep-alive
Referer: http://example.com/index.php?function=search&query=Pata+de+cambio+
Cookie: the cookie
"
["blocked-uri"]=>
string(4) "self"
["violated-directive"]=>
string(30) "inline script base restriction"
}
}
内容类型为application/json; charset=UTF-8
现在,我期望这应该在REQUEST_METHOD==POST的情况下可在$_POST中使用,但是$_POST总是为空。我可以从php://input访问它,但问题是:为什么请求在$_POST中不可用?
我甚至无法使用filter_input,$_REQUEST也为空...