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

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

        <legend id='1cakr'><style id='1cakr'><dir id='1cakr'><q id='1cakr'></q></dir></style></legend>

        • <bdo id='1cakr'></bdo><ul id='1cakr'></ul>

        <small id='1cakr'></small><noframes id='1cakr'>

        Chrome將Origin標頭添加到同源請求

        Chrome adding Origin header to same-origin request(Chrome將Origin標頭添加到同源請求)

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

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

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

                • <bdo id='veL0E'></bdo><ul id='veL0E'></ul>
                  本文介紹了Chrome將Origin標頭添加到同源請求的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我們正在向本地運行的服務器發布 AJAX 請求,即

                  We're POSTing an AJAX request to a server running locally, i.e.

                  xhr.open("POST", "http://localhost:9000/context/request");
                  xhr.addHeader(someCustomHeaders);
                  xhr.send(someData);
                  

                  這個 javascript 正在執行的頁面也是從 localhost:9000 提供的,也就是說,這看起來完全像一個同源請求.

                  The page that this javascript is being executed is also being served from localhost:9000, i.e. this totally looks like a same-origin request.

                  但是,由于某種原因,谷歌瀏覽器總是在結果請求中設置一個 Origin 標頭,導致我們的服務器基于錯誤假設它是 CORS 請求而阻止該請求.

                  However, for some reason, Google Chrome always sets an Origin header in the resulting request, causing our server to block the request based on the false assumption that it's CORS request.

                  這在 Firefox 中不會發生.

                  This does not happen in Firefox.

                  此外,Firefox 和 Chrome 都沒有發送 OPTIONS 預檢請求,這令人困惑;為什么在沒有預先檢查的情況下設置 Origin 標頭以確保服務器允許 Origin 和 Custom 標頭?

                  Also, neither Firefox nor Chrome are sending an OPTIONS preflight request, which is confusing; why set an Origin header without first preflighting to make sure the the Origin and the Custom headers are allowed by the server?

                  有誰知道這種情況下發生了什么?我們是否誤解了 CORS 規范?

                  Does anyone know what is going on in this case? Are we misunderstanding the CORS spec?

                  推薦答案

                  Chrome 和 Safari 在同源 POST/PUT/DELETE 請求中包含 Origin 標頭(同源 GET 請求不會有Origin 標頭).Firefox 在同源請求中不包含 Origin 標頭.瀏覽器不期望同源請求上的 CORS 響應標頭,因此對同源請求的響應將發送給用戶,無論它是否具有 CORS 標頭.

                  Chrome and Safari include an Origin header on same-origin POST/PUT/DELETE requests (same-origin GET requests will not have an Origin header). Firefox doesn't include an Origin header on same-origin requests. Browsers don't expect CORS response headers on same-origin requests, so the response to a same-origin request is sent to the user, regardless of whether it has CORS headers or not.

                  我建議檢查 Host 標頭,如果它與 Origin 標頭中的域匹配,則不要將請求視為 CORS.標題看起來像這樣:

                  I would recommend checking the Host header, and if it matches the domain in the Origin header, don't treat the request as CORS. The headers look something like this:

                  Host: example.com
                  Origin: http://example.com
                  

                  請注意,Origin 將有方案 (http/https)、域和端口,而 Host 將只有域和端口.

                  Note that Origin will have the scheme (http/https), domain and port, while Host will only have the domain and port.

                  這篇關于Chrome將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 部分內容)
                    <tfoot id='GNrb1'></tfoot>

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

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

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

                            主站蜘蛛池模板: 精品久久久久久18免费网站 | 黄色大片在线免费观看 | 亚洲精品视频播放 | 国产片侵犯亲女视频播放 | 美日韩中文字幕 | 国产真实精品久久二三区 | 精品久久香蕉国产线看观看亚洲 | 97国产精品视频 | 午夜在线观看视频 | 亚洲精品视频在线 | 一级黄色网页 | 三级视频网站 | 欧美阿v| 欧美中文字幕在线 | 成人av观看 | 日韩欧美成人一区二区三区 | 久久久精品视频一区二区三区 | 一本一道久久a久久精品综合蜜臀 | 国产黄色大片网站 | 亚洲精品在线播放 | 中文字幕精品一区二区三区在线 | 欧美一区二区三区在线视频 | 日韩一区在线播放 | 武道仙尊动漫在线观看 | 欧美国产精品 | 国产欧美日韩综合精品一区二区 | 日韩电影免费在线观看中文字幕 | 国产一区亚洲 | 成人久久 | 亚洲欧美高清 | 国产国产精品久久久久 | 久久久精品一区 | 欧美日韩亚洲国产 | 青草久久免费视频 | 视频1区 | av无遮挡| 怡红院免费的全部视频 | 欧美1区 | 日韩中文字幕一区二区 | 中文字幕国产 | 欧美成人免费在线视频 |