찾다

 >  Q&A  >  본문

php - chrome 关于refused to set unsage header "content-length" 如何解决

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

PHPzPHPz2894일 전693

모든 응답(2)나는 대답할 것이다

  • 数据分析师

    数据分析师2017-10-01 01:19:28

    php - chrome unsage 헤더 "content-length" 설정 거부 문제 해결 방법 - PHP 중국어 웹사이트 Q&A - php - chrome unsage 헤더 "content-length" 설정 거부 문제 해결 방법 - PHP 중국어 웹사이트 Q&A

    둘러보고, 공부해보세요.

    회신하다
    0
  • PHPz

    PHPz2017-04-10 13:11:24

    是的,实际上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匹配以上字符时,这一步骤将被终止

    회신하다
    0
  • 취소회신하다