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

      • <bdo id='9Z6ka'></bdo><ul id='9Z6ka'></ul>
      <tfoot id='9Z6ka'></tfoot>

        <legend id='9Z6ka'><style id='9Z6ka'><dir id='9Z6ka'><q id='9Z6ka'></q></dir></style></legend>
      1. <small id='9Z6ka'></small><noframes id='9Z6ka'>

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

        CORS 和 Origin 標(biāo)頭?

        CORS and Origin header?(CORS 和 Origin 標(biāo)頭?)

        <tfoot id='34Gyp'></tfoot>

        1. <legend id='34Gyp'><style id='34Gyp'><dir id='34Gyp'><q id='34Gyp'></q></dir></style></legend>

          <small id='34Gyp'></small><noframes id='34Gyp'>

                  <tbody id='34Gyp'></tbody>

                  <bdo id='34Gyp'></bdo><ul id='34Gyp'></ul>

                  <i id='34Gyp'><tr id='34Gyp'><dt id='34Gyp'><q id='34Gyp'><span id='34Gyp'><b id='34Gyp'><form id='34Gyp'><ins id='34Gyp'></ins><ul id='34Gyp'></ul><sub id='34Gyp'></sub></form><legend id='34Gyp'></legend><bdo id='34Gyp'><pre id='34Gyp'><center id='34Gyp'></center></pre></bdo></b><th id='34Gyp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='34Gyp'><tfoot id='34Gyp'></tfoot><dl id='34Gyp'><fieldset id='34Gyp'></fieldset></dl></div>
                  本文介紹了CORS 和 Origin 標(biāo)頭?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  當(dāng)我們需要調(diào)用 Ajax 請(qǐng)求時(shí):

                  if(typeof XMLHttpRequest !== 'undefined') xhr = new XMLHttpRequest();別的{var 版本 = ["Microsoft.XmlHttp","MSXML2.XmlHttp","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.4.0",MSXML2.XmlHttp.5.0"];

                  我已經(jīng)知道使用 XMLHttpRequest-2 ,我們可以做一個(gè)跨域請(qǐng)求 AND 添加 ORIGIN 標(biāo)頭.

                  問題:

                  • 什么時(shí)候添加了這個(gè)標(biāo)題?

                    • 是否在瀏覽器(支持 CORS)執(zhí)行請(qǐng)求時(shí)添加?(跨域還是非跨域?)
                    • 還是在瀏覽器看到"請(qǐng)求目標(biāo)來源與當(dāng)前來源不同時(shí)自動(dòng)添加...

                  我的意思是:He** 是什么意思?

                  <塊引用>

                  跨域 HTTP 請(qǐng)求有一個(gè) Origin 標(biāo)頭.這個(gè)標(biāo)題向服務(wù)器提供請(qǐng)求的來源.這個(gè)標(biāo)題是受瀏覽器保護(hù),不能從應(yīng)用程序代碼中更改.本質(zhì)上,它是找到的原始屬性的網(wǎng)絡(luò)等價(jià)物關(guān)于跨文檔消息傳遞中使用的消息事件.原始標(biāo)頭與較舊的referer [sic] 標(biāo)頭的不同之處在于,referer 是一個(gè)完整的 URL,包括路徑.因?yàn)槁窂娇赡馨舾行畔ⅲ瑸g覽器有時(shí)不會(huì)發(fā)送引用試圖保護(hù)用戶隱私.但是,瀏覽器將始終必要時(shí)發(fā)送所需的 Origin 標(biāo)頭.

                  解決方案

                  Origin標(biāo)頭

                  <塊引用>

                  何時(shí)添加此標(biāo)頭?

                  在標(biāo)頭階段,文檔正文發(fā)送之前(open之后,send之前).

                  <塊引用>

                  它是在瀏覽器(支持 CORS)發(fā)出請(qǐng)求時(shí)添加的嗎?(跨域還是非跨域?)

                  當(dāng)源與創(chuàng)建XMLHttpRequest的頁面不匹配時(shí)添加,但也可以在同源請(qǐng)求中發(fā)送.

                  <塊引用>

                  或者當(dāng)瀏覽器看到"請(qǐng)求目標(biāo)來源與當(dāng)前來源不同時(shí)是否自動(dòng)添加...

                  是的.

                  <塊引用>

                  但是,瀏覽器總是會(huì)在必要時(shí)發(fā)送所需的 Origin 標(biāo)頭.

                  這是 XMLHttpRequest 規(guī)范的一部分;如果您正在發(fā)出跨域請(qǐng)求,則會(huì)在請(qǐng)求標(biāo)頭中發(fā)送一個(gè)額外的標(biāo)頭.這個(gè)標(biāo)題是例如來源:http://www.stackoverflow.com,由遵循標(biāo)準(zhǔn)的瀏覽器附加,無需用戶交互.

                  <小時(shí)>

                  您可以在 MozillaWiki 的安全部分中閱讀有關(guān)規(guī)范的更多信息,WHATWG 和 html5.組織.它是由(據(jù)我所知)FireFox 和 Google Chrome 實(shí)現(xiàn)的.我不相信它是 W3C 的一部分.此外不要假設(shè)源頭是真實(shí)的,因?yàn)樗梢酝ㄟ^修改后的瀏覽器或其他軟件手動(dòng)設(shè)置.

                  When we need to invoke an Ajax request we do :

                  if(typeof XMLHttpRequest !== 'undefined') xhr = new XMLHttpRequest();
                  else
                  {
                      var versions = ["Microsoft.XmlHttp",
                              "MSXML2.XmlHttp",
                              "MSXML2.XmlHttp.3.0",
                              "MSXML2.XmlHttp.4.0",
                              "MSXML2.XmlHttp.5.0"
                      ];
                  

                  I already know that using XMLHttpRequest-2 ,we can make a cross origin request AND that the ORIGIN header is added.

                  Question:

                  • When does this header added ?

                    • Is it added when a browser (that support CORS) is performing a request ? ( cross domain or non-cross-domain?)
                    • Or is it added automatically when the browser "sees" that the request target origin is different from the current origin...

                  I mean : what the He** does the bold line mean ?

                  Cross-origin HTTP requests have an Origin header. This header provides the server with the request’s origin. This header is protected by the browser and cannot be changed from application code. In essence, it is the network equivalent of the origin property found on message events used in Cross Document Messaging. The origin header differs from the older referer [sic] header in that the referer is a complete URL including the path. Because the path may contain sensitive information, the referer is sometimes not sent by browsers attempting to protect user privacy. However, the browser will always send the required Origin headers when necessary.

                  解決方案

                  The Origin header

                  When this header is added ?

                  During the header's stage, before the document's body is sent (after open, before send).

                  Is it added when a browser (that support CORS) is doing a request ? ( cross domain or non-cross-domain?)

                  It is added when the origin doesn't match the page from which the XMLHttpRequest is created, but may also be sent in a same-origin request.

                  Or does it added automatically when the browser "sees" that the request target origin is different from the current origin...

                  Yes.

                  However, the browser will always send the required Origin headers when necessary.

                  This is part of the XMLHttpRequest spec; if you're making a cross-domain request, in the request headers an extra header is sent. This header is e.g. Origin: http://www.stackoverflow.com and is appended by a standards-following browser without user interaction.


                  You can read more on the specification in MozillaWiki's Security section, WHATWG and html5.org. It is implemented by (that I know of) FireFox and Google Chrome. I don't believe it is part of W3C yet. Further do not assume the origin header is true, as it can be set manually by modified borwsers or other software.

                  這篇關(guān)于CORS 和 Origin 標(biāo)頭?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 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 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)

                  <legend id='xHb3A'><style id='xHb3A'><dir id='xHb3A'><q id='xHb3A'></q></dir></style></legend>
                      <tbody id='xHb3A'></tbody>
                    <tfoot id='xHb3A'></tfoot>
                    • <bdo id='xHb3A'></bdo><ul id='xHb3A'></ul>

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

                        1. <i id='xHb3A'><tr id='xHb3A'><dt id='xHb3A'><q id='xHb3A'><span id='xHb3A'><b id='xHb3A'><form id='xHb3A'><ins id='xHb3A'></ins><ul id='xHb3A'></ul><sub id='xHb3A'></sub></form><legend id='xHb3A'></legend><bdo id='xHb3A'><pre id='xHb3A'><center id='xHb3A'></center></pre></bdo></b><th id='xHb3A'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xHb3A'><tfoot id='xHb3A'></tfoot><dl id='xHb3A'><fieldset id='xHb3A'></fieldset></dl></div>
                            主站蜘蛛池模板: 日韩欧美国产一区二区 | 欧美在线一区二区三区 | 精品久久久久久亚洲精品 | 亚洲人在线观看视频 | 精品一区二区三区在线视频 | 亚洲国产精品久久 | 高清av在线 | 国产免费视频 | 亚洲乱码一区二区 | 免费簧片视频 | 亚洲久久一区 | www日本在线 | 成人精品久久 | 一级黄色毛片 | 久国产视频 | 丝袜一区二区三区 | 国内精品视频一区二区三区 | 91高清免费观看 | 亚洲三级av| 国产日韩一区二区三区 | 亚洲97 | 国产精品久久久久久久7电影 | 亚洲一区中文字幕 | 在线观看深夜视频 | 麻豆changesxxx国产 | 日韩精品一区二区三区在线播放 | 久久美女视频 | 免费黄色的视频 | 久久久久久国产 | 成人一区二区在线 | 麻豆视频在线免费观看 | 久久综合九九 | 成人精品毛片国产亚洲av十九禁 | 亚洲成人av在线播放 | 日韩在线视频免费观看 | 毛片一区二区三区 | 特级做a爱片免费69 精品国产鲁一鲁一区二区张丽 | 久久四虎| 99久久精品国产一区二区三区 | 久久99精品久久久久久国产越南 | 中文字幕第一页在线 |