pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <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="ikfojp8" 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 “拒絕設(shè)置不安全的標(biāo)頭‘內(nèi)容長度’&qu

        WebKit quot;Refused to set unsafe header #39;content-length#39;quot;(WebKit “拒絕設(shè)置不安全的標(biāo)頭‘內(nèi)容長度’)
            • <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="21a8cp8" id='zzoeL'><tfoot id='zzoeL'></tfoot><dl id='zzoeL'><fieldset id='zzoeL'></fieldset></dl></div>
                  本文介紹了WebKit “拒絕設(shè)置不安全的標(biāo)頭‘內(nèi)容長度’"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  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 調(diào)用并生成它自己的

                  it is also ignoring my setRequestHeader calls and generating its own

                  是的,標(biāo)準(zhǔn)說它必須:

                  出于安全原因,如果標(biāo)題為 [...],則應(yīng)終止這些步驟

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

                  • 連接
                  • 內(nèi)容長度

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

                  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().

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

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  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標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  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 部分內(nèi)容)
                    <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="fwd38xm" id='WPpie'><tfoot id='WPpie'></tfoot><dl id='WPpie'><fieldset id='WPpie'></fieldset></dl></div>
                          2. <small id='WPpie'></small><noframes id='WPpie'>

                            主站蜘蛛池模板: 镀锌方管,无缝方管,伸缩套管,方矩管_山东重鑫致胜金属制品有限公司 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 交流伺服电机|直流伺服|伺服驱动器|伺服电机-深圳市华科星电气有限公司 | 南京蜂窝纸箱_南京木托盘_南京纸托盘-南京博恒包装有限公司 | 智慧养老_居家养老_社区养老_杰佳通 | 不锈钢列管式冷凝器,换热器厂家-无锡飞尔诺环境工程有限公司 | 快速门厂家-快速卷帘门-工业快速门-硬质快速门-西朗门业 | NM-02立式吸污机_ZHCS-02软轴刷_二合一吸刷软轴刷-厦门地坤科技有限公司 | 刑事律师_深圳著名刑事辩护律师_王平聚【清华博士|刑法教授】 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | 免费B2B信息推广发布平台 - 推发网 | 不锈钢/气体/液体玻璃转子流量计(防腐,选型,规格)-常州天晟热工仪表有限公司【官网】 | 气动球阀_衬氟蝶阀_调节阀_电动截止阀_上海沃托阀门有限公司 | loft装修,上海嘉定酒店式公寓装修公司—曼城装饰 | C形臂_动态平板DR_动态平板胃肠机生产厂家制造商-普爱医疗 | 上海深蓝_缠绕机_缠膜机-上海深蓝机械装备有限公司 | 劳动法网-专业的劳动法和劳动争议仲裁服务网 | 苏州注册公司_苏州代理记账_苏州工商注册_苏州代办公司-恒佳财税 | 西宁装修_西宁装修公司-西宁业之峰装饰-青海业之峰墅级装饰设计公司【官网】 | Q361F全焊接球阀,200X减压稳压阀,ZJHP气动单座调节阀-上海戎钛 | 武汉高低温试验机-现货恒温恒湿试验箱-高低温湿热交变箱价格-湖北高天试验设备 | 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 | 特材真空腔体_哈氏合金/镍基合金/纯镍腔体-无锡国德机械制造有限公司 | pbootcms网站模板|织梦模板|网站源码|jquery建站特效-html5模板网 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | 电镀电源整流器_高频电解电源_单脉双脉冲电源 - 东阳市旭东电子科技 | 空气净化器租赁,空气净化器出租,全国直租_奥司汀净化器租赁 | 深圳市索富通实业有限公司-可燃气体报警器 | 可燃气体探测器 | 气体检测仪 | 冰晶石|碱性嫩黄闪蒸干燥机-有机垃圾烘干设备-草酸钙盘式干燥机-常州市宝康干燥 | 南京精锋制刀有限公司-纵剪机刀片_滚剪机刀片_合金刀片厂家 | 偏心半球阀-电动偏心半球阀-调流调压阀-旋球阀-上欧阀门有限公司 | 双齿辊破碎机-大型狼牙破碎机视频-对辊破碎机价格/型号图片-金联机械设备生产厂家 | 洗地机_全自动洗地机_手推式洗地机【上海滢皓环保】 | 隧道窑炉,隧道窑炉厂家-山东艾瑶国际贸易 | 厂房出售_厂房仓库出租_写字楼招租_土地出售-中苣招商网-中苣招商网 | 平面钻,法兰钻,三维钻-山东兴田阳光智能装备股份有限公司 | 聚氨酯保温钢管_聚氨酯直埋保温管道_聚氨酯发泡保温管厂家-沧州万荣防腐保温管道有限公司 | 珠海冷却塔降噪维修_冷却塔改造报价_凉水塔风机维修厂家- 广东康明节能空调有限公司 | 武汉EPS线条_EPS装饰线条_EPS构件_湖北博欧EPS线条厂家 | 钢结构-钢结构厂房-钢结构工程[江苏海逵钢构厂] | 硫化罐_蒸汽硫化罐_大型硫化罐-山东鑫泰鑫智能装备有限公司 |