久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <tfoot id='Q39lF'></tfoot>
      1. <i id='Q39lF'><tr id='Q39lF'><dt id='Q39lF'><q id='Q39lF'><span id='Q39lF'><b id='Q39lF'><form id='Q39lF'><ins id='Q39lF'></ins><ul id='Q39lF'></ul><sub id='Q39lF'></sub></form><legend id='Q39lF'></legend><bdo id='Q39lF'><pre id='Q39lF'><center id='Q39lF'></center></pre></bdo></b><th id='Q39lF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Q39lF'><tfoot id='Q39lF'></tfoot><dl id='Q39lF'><fieldset id='Q39lF'></fieldset></dl></div>
          <bdo id='Q39lF'></bdo><ul id='Q39lF'></ul>

        <legend id='Q39lF'><style id='Q39lF'><dir id='Q39lF'><q id='Q39lF'></q></dir></style></legend>

        <small id='Q39lF'></small><noframes id='Q39lF'>

      2. WebKit “拒絕設置不安全的標頭‘內容長度’&qu

        WebKit quot;Refused to set unsafe header #39;content-length#39;quot;(WebKit “拒絕設置不安全的標頭‘內容長度’)
            • <bdo id='zzoeL'></bdo><ul id='zzoeL'></ul>

            • <small id='zzoeL'></small><noframes id='zzoeL'>

              <tfoot id='zzoeL'></tfoot>
                <tbody id='zzoeL'></tbody>
                  <legend id='zzoeL'><style id='zzoeL'><dir id='zzoeL'><q id='zzoeL'></q></dir></style></legend>
                1. <i id='zzoeL'><tr id='zzoeL'><dt id='zzoeL'><q id='zzoeL'><span id='zzoeL'><b id='zzoeL'><form id='zzoeL'><ins id='zzoeL'></ins><ul id='zzoeL'></ul><sub id='zzoeL'></sub></form><legend id='zzoeL'></legend><bdo id='zzoeL'><pre id='zzoeL'><center id='zzoeL'></center></pre></bdo></b><th id='zzoeL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zzoeL'><tfoot id='zzoeL'></tfoot><dl id='zzoeL'><fieldset id='zzoeL'></fieldset></dl></div>
                  本文介紹了WebKit “拒絕設置不安全的標頭‘內容長度’"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試實現簡單的 xhr 抽象,并在嘗試為 POST 設置標頭時收到此警告.我認為這可能與在單獨的 js 文件中設置標題有關,因為當我在 .html 文件的 <script> 標記中設置它們時,它工作正常.POST 請求工作正常,但我收到此警告,我很好奇為什么.對于 content-lengthconnection 標頭,我都會收到此警告,但僅限于 WebKit 瀏覽器(Chrome 5 beta 和 Safari 4).在 Firefox 中,我沒有收到任何警告,Content-Length 標頭設置為正確的值,但 Connection 設置為 keep-alive 而不是 close,這讓我認為它也忽略了我的 setRequestHeader 調用并生成它自己的.我沒有在 IE 中嘗試過這段代碼.這是標記和代碼:

                  I am trying to implement simple xhr abstraction, and am getting this warning when trying to set the headers for a POST. I think it might have something to do with setting the headers in a separate js file, because when i set them in the <script> tag in the .html file, it worked fine. The POST request is working fine, but I get this warning, and am curious why. I get this warning for both content-length and connection headers, but only in WebKit browsers (Chrome 5 beta and Safari 4). In Firefox, I don't get any warnings, the Content-Length header is set to the correct value, but the Connection is set to keep-alive instead of close, which makes me think that it is also ignoring my setRequestHeader calls and generating it's own. I have not tried this code in IE. Here is the markup & code:

                  test.html:

                  <!DOCTYPE html>
                  <html>
                      <head>
                          <script src="jsfile.js"></script>
                          <script>
                              var request = new Xhr('POST', 'script.php', true, 'data=somedata',  function(data) { 
                                  console.log(data.text); 
                              });
                          </script>
                      </head>
                      <body>
                      </body>
                  </html>
                  

                  jsfile.js:

                  function Xhr(method, url, async, data, callback) {
                      var x;
                      if(window.XMLHttpRequest) {
                          x = new XMLHttpRequest();
                  
                          x.open(method, url, async);
                  
                          x.onreadystatechange = function() {
                              if(x.readyState === 4) {
                                  if(x.status === 200) {
                                      var data = {
                                          text: x.responseText,
                                          xml: x.responseXML
                                      };
                                      callback.call(this, data);
                                  }
                              }
                          }
                  
                          if(method.toLowerCase() === "post") {
                              x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                              x.setRequestHeader("Content-Length", data.length);
                              x.setRequestHeader("Connection", "close");
                          }
                  
                          x.send(data);
                      } else {
                          // ... implement IE code here ...
                      }
                      return x;
                  }
                  

                  推薦答案

                  它也忽略了我的 setRequestHeader 調用并生成它自己的

                  it is also ignoring my setRequestHeader calls and generating its own

                  是的,標準說它必須:

                  出于安全原因,如果標題為 [...],則應終止這些步驟

                  For security reasons, these steps should be terminated if header is [...]

                  • 連接
                  • 內容長度

                  搞砸這些可能會暴露各種請求走私攻擊,所以瀏覽器總是使用自己的價值觀.沒有必要也沒有理由嘗試設置請求長度,因為瀏覽器可以根據您傳遞給 send() 的數據長度準確地做到這一點.

                  Messing around with those could expose various request smuggling attacks, so the browser always uses its own values. There's no need or reason to try to set the request length, as the browser can do that accurately from the length of data you pass to send().

                  這篇關于WebKit “拒絕設置不安全的標頭‘內容長度’"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                    <tbody id='WPpie'></tbody>

                    <tfoot id='WPpie'></tfoot>

                        • <bdo id='WPpie'></bdo><ul id='WPpie'></ul>
                          1. <legend id='WPpie'><style id='WPpie'><dir id='WPpie'><q id='WPpie'></q></dir></style></legend>
                            <i id='WPpie'><tr id='WPpie'><dt id='WPpie'><q id='WPpie'><span id='WPpie'><b id='WPpie'><form id='WPpie'><ins id='WPpie'></ins><ul id='WPpie'></ul><sub id='WPpie'></sub></form><legend id='WPpie'></legend><bdo id='WPpie'><pre id='WPpie'><center id='WPpie'></center></pre></bdo></b><th id='WPpie'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WPpie'><tfoot id='WPpie'></tfoot><dl id='WPpie'><fieldset id='WPpie'></fieldset></dl></div>
                          2. <small id='WPpie'></small><noframes id='WPpie'>

                            主站蜘蛛池模板: 国产精品一区二区视频 | 九九在线精品视频 | 男人的天堂久久 | 久久久久久国产精品免费免费男同 | 亚洲一区二区三 | 欧美日韩一区精品 | 中文字幕一区二区三区乱码在线 | 成人av在线播放 | 国产精品国色综合久久 | 国产精品久久九九 | 国产精品久久久久久网站 | 国产精品一区二区三级 | 免费99视频 | 国产精品久久久久久婷婷天堂 | 99久久久久久99国产精品免 | 日韩国产欧美视频 | 亚洲a视频 | 久久综合久久久 | 曰批视频在线观看 | 色播99| 久久久久亚洲精品国产 | 久热久热| 日韩一区精品 | 欧美xxxx黑人又粗又长 | av免费电影在线 | 欧美成人a| 欧美成人hd | 日韩精品无码一区二区三区 | 国产高清久久久 | 四季久久免费一区二区三区四区 | 亚洲精品久久国产高清情趣图文 | 久久久久一区 | 久久久久久久久99 | 一级美国黄色片 | 999re5这里只有精品 | 午夜在线视频一区二区三区 | 81精品国产乱码久久久久久 | 91精品国产综合久久久久久 | av日韩高清 | 日本精品免费 | 国产成人精品一区二 |