php - chrome 关于refused to set unsage header "content-length" 如何解决
PHPz
PHPz 2017-04-10 13:09:24
0
2
660

我使用php+ajax学习进行网站建设,当使用 xmlHttp.setRequestHeader("content-length",Querystring.length); 时,在chorme里出现了这个错误,在webkit的浏览器里都会出现这个问题,请问如何解决呢? 它提示,这是不安全吗。那么该如何改呢?

PHPz
PHPz

学习是最好的投资!

reply all(2)
数据分析师

php - chrome How to solve the problem of refused to set unsage header "content-length"-PHP Chinese website Q&A-php - chrome How to solve the problem of refused to set unsage header "content-length"-PHP Chinese website Q&A

Take a look around and learn.

PHPzhong

是的,实际上chrome是按照w3c标准来执行的,你可以看这里的原文描述,http://www.w3.org/TR/XMLHttpRequest/#...

我把它摘录出来

Terminate these steps if header is a case-insensitive match for one of the following headers:

Accept-Charset
Accept-Encoding
Connection
Content-Length
Cookie
Cookie2
Content-Transfer-Encoding
Date
Expect
Host
Keep-Alive
Referer
TE
Trailer
Transfer-Encoding
Upgrade
User-Agent
Via

也就是说,当你的header匹配以上字符时,这一步骤将被终止

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!