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

  • <i id='JnV4q'><tr id='JnV4q'><dt id='JnV4q'><q id='JnV4q'><span id='JnV4q'><b id='JnV4q'><form id='JnV4q'><ins id='JnV4q'></ins><ul id='JnV4q'></ul><sub id='JnV4q'></sub></form><legend id='JnV4q'></legend><bdo id='JnV4q'><pre id='JnV4q'><center id='JnV4q'></center></pre></bdo></b><th id='JnV4q'></th></span></q></dt></tr></i><div class="eq0acmc" id='JnV4q'><tfoot id='JnV4q'></tfoot><dl id='JnV4q'><fieldset id='JnV4q'></fieldset></dl></div>

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

    <tfoot id='JnV4q'></tfoot>

      <bdo id='JnV4q'></bdo><ul id='JnV4q'></ul>

      1. <legend id='JnV4q'><style id='JnV4q'><dir id='JnV4q'><q id='JnV4q'></q></dir></style></legend>
      2. 從 &lt;iframe&gt; 發(fā)出的 XHR 請求的 Origin 標頭

        Origin header null for XHR request made from lt;iframegt; with sandbox attribute(從 lt;iframegt; 發(fā)出的 XHR 請求的 Origin 標頭為空帶沙盒屬性)
          <tbody id='QyWVD'></tbody>

            <bdo id='QyWVD'></bdo><ul id='QyWVD'></ul>
            <tfoot id='QyWVD'></tfoot>
            • <small id='QyWVD'></small><noframes id='QyWVD'>

              <legend id='QyWVD'><style id='QyWVD'><dir id='QyWVD'><q id='QyWVD'></q></dir></style></legend>
              <i id='QyWVD'><tr id='QyWVD'><dt id='QyWVD'><q id='QyWVD'><span id='QyWVD'><b id='QyWVD'><form id='QyWVD'><ins id='QyWVD'></ins><ul id='QyWVD'></ul><sub id='QyWVD'></sub></form><legend id='QyWVD'></legend><bdo id='QyWVD'><pre id='QyWVD'><center id='QyWVD'></center></pre></bdo></b><th id='QyWVD'></th></span></q></dt></tr></i><div class="mwwmqoi" id='QyWVD'><tfoot id='QyWVD'></tfoot><dl id='QyWVD'><fieldset id='QyWVD'></fieldset></dl></div>

                • 本文介紹了從 &lt;iframe&gt; 發(fā)出的 XHR 請求的 Origin 標頭為空帶沙盒屬性的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個項目,我正在嘗試從數據處理程序以制表符分隔值格式下載一些數據,但是,Google Chrome 正在為 Origin 標頭值發(fā)送空值.

                  I have a project where I am trying download some data in a tab separated value format from a datahandler however, Google Chrome is sending a null value for the Origin header value.

                  當我導航到 http://server.corp.somebiz.com/reportpages/Report_Page_Requests_Over_Time.aspx?app=76ac42b7-ba6f-4be4-b297-758ebc9fe615

                  var url = 'http://server.corp.somebiz.com/DataHandlers/ReportSets.ashx?task=pagerequestsovertime&app=188d1956-c4a7-42f7-9bdd-38f54c14e125&format=tsv';
                  
                  d3.tsv(url, function(d) {
                    d.date = parseTime(d.date);
                    d.close = +d.close;
                    return d;
                  }, function(error, data) {
                    if (error) throw error;
                  
                    console.log('Do stuff');
                  });
                  

                  以下是請求的原始標頭:

                  Here are the raw headers on the request:

                  GET /DataHandlers/ReportSets.ashx?task=pagerequestsovertime&app=786b5ef3-1389-4890-8004-533fd1f66f16&format=tsv HTTP/1.1
                  Host: server.corp.somebiz.com
                  Connection: keep-alive
                  accept: text/tab-separated-values,*/*
                  Origin: null
                  User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
                  Accept-Encoding: gzip, deflate, sdch
                  Accept-Language: en-US,en;q=0.8
                  

                  這以控制臺上的錯誤結束:

                  This ends with an error on the console:

                  XMLHttpRequest cannot load http://server.corp.somebiz.com/DataHandlers/ReportSets.ashx?task=pagere…6ac42b7-ba6f-4be4-b297-758ebc9fe615&start=2/1/2017&end=3/2/2017&format=tsv. The 'Access-Control-Allow-Origin' header has a value 'http://server.corp.somebiz.com' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.
                  

                  我不僅要查找為什么會發(fā)生這種情況,還要查找導致 Chrome 向服務器發(fā)送空 Origin 標頭的條件.

                  Not only am I looking for the why is this happening, what the conditions are that leads to Chrome sending a null Origin header to the server.

                  這似乎是 Chrome 特有的問題,因為 Internet Explorer 11 正在向服務器發(fā)送正確的 Origin 值.

                  This seems to be a Chrome specific issue as Internet Explorer 11 is sending the proper Origin value to the server.

                  更新:添加另一個皺紋,這可能是也可能不是促成因素.

                  Update: To add another wrinkle, that may or may not be a contributing factor.

                  我在 <iframe> 元素中加載調用頁面以隔離腳本化元素.在 iframe 之外調用頁面會導致不同的行為,Chrome 上的 Origin 標頭完全丟失.

                  I load the calling page in an <iframe> element to isolate scripted elements. Calling the page outside of the iframe causes a different behavior, the Origin header on Chrome is missing entirely.

                  推薦答案

                  如果你加載調用頁面的 iframe 有一個 sandbox 屬性不包含值 allow-same-origin, 瀏覽器給它一個唯一"的來源:

                  If the iframe you’re loading the calling page in has a sandbox attribute that doesn’t contain the value allow-same-origin, browsers give it a "unique" origin:

                  當設置 [sandbox] 屬性時,內容被視為來自唯一來源,禁用表單、腳本和各種可能令人討厭的 API,阻止鏈接針對其他瀏覽上下文,并且插件是安全的.allow-same-origin 關鍵字導致內容被視為來自其真實來源,而不是強制它成為唯一來源

                  When the [sandbox] attribute is set, the content is treated as being from a unique origin, forms, scripts, and various potentially annoying APIs are disabled, links are prevented from targeting other browsing contexts, and plugins are secured. The allow-same-origin keyword causes the content to be treated as being from its real origin instead of forcing it into a unique origin

                  ...當確定要在跨域請求中發(fā)送的 Origin 標頭的值時,瀏覽器將任何唯一的來源序列化為 null 并給出 Origin 標頭該值.

                  …and when determining the value of the Origin header to send in a cross-origin request, browsers serialize any unique origin as null and give the Origin header that value.

                  這篇關于從 &lt;iframe&gt; 發(fā)出的 XHR 請求的 Origin 標頭為空帶沙盒屬性的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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屋-程序員軟件開發(fā)技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                • <i id='bvIde'><tr id='bvIde'><dt id='bvIde'><q id='bvIde'><span id='bvIde'><b id='bvIde'><form id='bvIde'><ins id='bvIde'></ins><ul id='bvIde'></ul><sub id='bvIde'></sub></form><legend id='bvIde'></legend><bdo id='bvIde'><pre id='bvIde'><center id='bvIde'></center></pre></bdo></b><th id='bvIde'></th></span></q></dt></tr></i><div class="wowaikc" id='bvIde'><tfoot id='bvIde'></tfoot><dl id='bvIde'><fieldset id='bvIde'></fieldset></dl></div>

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

                    <tbody id='bvIde'></tbody>

                      <legend id='bvIde'><style id='bvIde'><dir id='bvIde'><q id='bvIde'></q></dir></style></legend>
                      • <bdo id='bvIde'></bdo><ul id='bvIde'></ul>

                            <tfoot id='bvIde'></tfoot>
                            主站蜘蛛池模板: 全自动真空上料机_粉末真空上料机_气动真空上料机-南京奥威环保科技设备有限公司 | 北京印刷厂_北京印刷_北京印刷公司_北京印刷厂家_北京东爵盛世印刷有限公司 | 一体化污水处理设备,一体化污水设备厂家-宜兴市福源水处理设备有限公司 | 山东彩钢板房,山东彩钢活动房,临沂彩钢房-临沂市贵通钢结构工程有限公司 | 中药二氧化硫测定仪,食品二氧化硫测定仪|俊腾百科 | 电动葫芦|手拉葫芦|环链电动葫芦|微型电动葫芦-北京市凌鹰起重机械有限公司 | 河北中仪伟创试验仪器有限公司是专业生产沥青,土工,水泥,混凝土等试验仪器的厂家,咨询电话:13373070969 | 车牌识别道闸_停车场收费系统_人脸识别考勤机_速通门闸机_充电桩厂家_中全清茂官网 | 书法培训-高考书法艺考培训班-山东艺霖书法培训凭实力挺进央美 | 电缆接头_防水接头_电缆防水接头_防水电缆接头_上海闵彬 | 莱州网络公司|莱州网站建设|莱州网站优化|莱州阿里巴巴-莱州唯佳网络科技有限公司 | 泰安办公家具-泰安派格办公用品有限公司 | 高空重型升降平台_高空液压举升平台_高空作业平台_移动式升降机-河南华鹰机械设备有限公司 | 淬火设备-钎焊机-熔炼炉-中频炉-锻造炉-感应加热电源-退火机-热处理设备-优造节能 | 高速龙门架厂家_监控杆_多功能灯杆_信号灯杆_锂电池太阳能路灯-鑫世源照明 | 番茄畅听邀请码怎么输入 - Dianw8.com | 无机纤维喷涂棉-喷涂棉施工工程-山东华泉建筑工程有限公司▲ | 垃圾处理设备_餐厨垃圾处理设备_厨余垃圾处理设备_果蔬垃圾处理设备-深圳市三盛环保科技有限公司 | 无锡网站建设-做网站-建网站-网页设计制作-阿凡达建站公司 | 长沙中央空调维修,中央空调清洗维保,空气能热水工程,价格,公司就找维小保-湖南维小保环保科技有限公司 | 螺钉式热电偶_便携式温度传感器_压簧式热电偶|无锡联泰仪表有限公司|首页 | 金属抛光机-磁悬浮抛光机-磁力研磨机-磁力清洗机 - 苏州冠古科技 | 光伏支架成型设备-光伏钢边框设备-光伏设备厂家 | 陕西安闸机-伸缩门-车牌识别-广告道闸——捷申达门业科技 | DWS物流设备_扫码称重量方一体机_快递包裹分拣机_广东高臻智能装备有限公司 | 风淋室生产厂家报价_传递窗|送风口|臭氧机|FFU-山东盛之源净化设备 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | 上海佳武自动化科技有限公司 | 清水-铝合金-建筑模板厂家-木模板价格-铝模板生产「五棵松」品牌 | 综合管廊模具_生态,阶梯护坡模具_检查井模具制造-致宏模具厂家 | J.S.Bach 圣巴赫_高端背景音乐系统_官网| Type-c防水母座|贴片母座|耳机接口|Type-c插座-深圳市步步精科技有限公司 | 华中线缆有限公司-电缆厂|电缆厂家|电线电缆厂家 | 广西绿桂涂料--承接隔热涂料、隔音涂料、真石漆、多彩仿石漆等涂料工程双包施工 | 安徽净化板_合肥岩棉板厂家_玻镁板厂家_安徽科艺美洁净科技有限公司 | 许昌奥仕达自动化设备有限公司| 【法利莱住人集装箱厂家】—活动集装箱房,集装箱租赁_大品牌,更放心 | 上海皓越真空设备有限公司官网-真空炉-真空热压烧结炉-sps放电等离子烧结炉 | 阻垢剂,反渗透阻垢剂,缓蚀阻垢剂-山东普尼奥水处理科技有限公司 真空粉体取样阀,电动楔式闸阀,电动针型阀-耐苛尔(上海)自动化仪表有限公司 | 电动垃圾车,垃圾清运车-江苏速利达机车有限公司 | 广州活动策划公司-15+年专业大型公关活动策划执行管理经验-睿阳广告 |