久久久久久久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 標頭?

        CORS and Origin header?(CORS 和 Origin 標頭?)

        <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 標頭?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  當我們需要調用 Ajax 請求時:

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

                  我已經知道使用 XMLHttpRequest-2 ,我們可以做一個跨域請求 AND 添加 ORIGIN 標頭.

                  問題:

                  • 什么時候添加了這個標題?

                    • 是否在瀏覽器(支持 CORS)執行請求時添加?(跨域還是非跨域?)
                    • 還是在瀏覽器看到"請求目標來源與當前來源不同時自動添加...

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

                  <塊引用>

                  跨域 HTTP 請求有一個 Origin 標頭.這個標題向服務器提供請求的來源.這個標題是受瀏覽器保護,不能從應用程序代碼中更改.本質上,它是找到的原始屬性的網絡等價物關于跨文檔消息傳遞中使用的消息事件.原始標頭與較舊的referer [sic] 標頭的不同之處在于,referer 是一個完整的 URL,包括路徑.因為路徑可能包含敏感信息,瀏覽器有時不會發送引用試圖保護用戶隱私.但是,瀏覽器將始終必要時發送所需的 Origin 標頭.

                  解決方案

                  Origin標頭

                  <塊引用>

                  何時添加此標頭?

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

                  <塊引用>

                  它是在瀏覽器(支持 CORS)發出請求時添加的嗎?(跨域還是非跨域?)

                  當源與創建XMLHttpRequest的頁面不匹配時添加,但也可以在同源請求中發送.

                  <塊引用>

                  或者當瀏覽器看到"請求目標來源與當前來源不同時是否自動添加...

                  是的.

                  <塊引用>

                  但是,瀏覽器總是會在必要時發送所需的 Origin 標頭.

                  這是 XMLHttpRequest 規范的一部分;如果您正在發出跨域請求,則會在請求標頭中發送一個額外的標頭.這個標題是例如來源:http://www.stackoverflow.com,由遵循標準的瀏覽器附加,無需用戶交互.

                  <小時>

                  您可以在 MozillaWiki 的安全部分中閱讀有關規范的更多信息,WHATWG 和 html5.組織.它是由(據我所知)FireFox 和 Google Chrome 實現的.我不相信它是 W3C 的一部分.此外不要假設源頭是真實的,因為它可以通過修改后的瀏覽器或其他軟件手動設置.

                  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.

                  這篇關于CORS 和 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屋-程序員軟件開發技術分
                  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 部分內容)

                  <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黑人 | 亚洲精品区 | 国产一区久久 | 亚洲精品久久久一区二区三区 | 97视频在线观看免费 | av第一页| 中文字幕精品一区 | 国产精品成人品 | 亚洲精品成人 | 久久久精品国产 | 欧美日韩在线免费观看 | 一区二区三区免费 | 午夜视频网站 | 波多野结衣精品在线 | 成人免费在线视频 | 91综合网 | 亚洲精品久久久蜜桃 | 成年人在线观看视频 | 日本久久精品视频 | 国产乡下妇女做爰 | 91精品国产乱码麻豆白嫩 | 一本岛道一二三不卡区 | 国产精品久久久久久婷婷天堂 | 自拍偷拍第一页 | 六月成人网 | av电影一区二区 | 在线欧美| 特黄视频 | 亚洲高清一区二区三区 | 亚洲欧美激情精品一区二区 | 激情五月综合 | 偷拍自拍第一页 | av在线一区二区 | 午夜精品久久久久久久星辰影院 | 在线不卡av | 日日噜噜噜夜夜爽爽狠狠视频, | 精品国产乱码久久久久久88av | 黄色av一区 | 亚洲视频免费播放 |