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

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

    • <bdo id='LH7D3'></bdo><ul id='LH7D3'></ul>
    1. <tfoot id='LH7D3'></tfoot>

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

      拒絕設置不安全的標頭“Origin"使用谷歌瀏覽

      Refused to set unsafe header quot;Originquot; when using xmlHttpRequest of Google Chrome(拒絕設置不安全的標頭“Origin使用谷歌瀏覽器的 xmlHttpRequest 時)

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

          <legend id='9lSf6'><style id='9lSf6'><dir id='9lSf6'><q id='9lSf6'></q></dir></style></legend>

          <small id='9lSf6'></small><noframes id='9lSf6'>

        • <tfoot id='9lSf6'></tfoot>
            • <bdo id='9lSf6'></bdo><ul id='9lSf6'></ul>
              • 本文介紹了拒絕設置不安全的標頭“Origin"使用谷歌瀏覽器的 xmlHttpRequest 時的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                收到此錯誤消息:拒絕設置不安全的標頭Origin"

                使用此代碼:

                   function getResponse() {
                            document.getElementById("_receivedMsgLabel").innerHTML += "getResponse() called.<br/>";
                            if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
                                receiveReq.open("GET", "http://L45723:1802", true, "server", "server123");  //must use L45723:1802 at work.
                                receiveReq.onreadystatechange = handleReceiveMessage;
                                receiveReq.setRequestHeader("Origin", "http://localhost/");
                                receiveReq.setRequestHeader("Access-Control-Request-Origin", "http://localhost");
                                receiveReq.timeout = 0;
                                var currentDate = new Date();
                                var sendMessage = JSON.stringify({
                                    SendTimestamp: currentDate,
                                    Message: "Message 1",
                                    Browser: navigator.appName
                                });
                                receiveReq.send(sendMessage);
                
                            }
                        }
                

                我做錯了什么?為了使這個 CORS 請求正常工作,我在標頭中遺漏了什么?

                What am I doing wrong? What am I missing in the header to make this CORS request work?

                我嘗試刪除 receiveReq.setRequestHeader("Origin", ...) 調用,但 Google Chrome 在我的 receiveReq.open() 調用中引發訪問錯誤...

                I tried removing the receiveReq.setRequestHeader("Origin", ...) call but then Google Chrome throws an access error on my receiveReq.open() call...

                為什么?

                推薦答案

                這只是一個猜測,因為我使用 jquery 處理 ajax 請求,包括 CORS.

                This is just a guess, as I use jquery for ajax requests, including CORS.

                我認為瀏覽器應該設置標題,而不是你.如果您能夠設置標題,那將破壞安全功能的目的.

                I think the browser is supposed to set the header, not you. If you were able to set the header, that would defeat the purpose of the security feature.

                在不設置這些標頭的情況下嘗試請求,看看瀏覽器是否為您設置了它們.

                Try the request without setting those headers and see if the browser sets them for you.

                這篇關于拒絕設置不安全的標頭“Origin"使用谷歌瀏覽器的 xmlHttpRequest 時的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                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 部分內容)
                Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                <tfoot id='9uUYs'></tfoot>
              • <small id='9uUYs'></small><noframes id='9uUYs'>

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

                    • <bdo id='9uUYs'></bdo><ul id='9uUYs'></ul>

                        1. 主站蜘蛛池模板: 亚洲高清免费视频 | 欧美天堂 | 男女免费观看在线爽爽爽视频 | 性国产xxxx乳高跟 | 在线国产视频 | 日韩三级电影在线看 | 91精品久久久久久久久 | www.日韩系列| 日韩在线精品视频 | 欧美综合国产精品久久丁香 | 日本欧美国产 | 亚洲视频一区在线 | 精品久 | 国产精品久久久久久久免费观看 | 精品久久久久久亚洲精品 | 国产精品一区二 | 成人在线观看中文字幕 | a在线观看 | 日韩一区不卡 | 婷婷激情综合 | 黄色大片在线视频 | 神马久久久久久久久久 | 中文字幕不卡在线观看 | 91在线电影 | 成人免费一区二区 | 久久亚洲一区 | 国产精品美女一区二区三区 | 久久中文字幕视频 | 国产精品片 | 在线观看视频你懂得 | 95国产精品| 中文字幕在线看第二 | 欧美一级黄视频 | 国产免费一区二区 | 中文字幕av网站 | 日本久久网 | 国产精品九九九 | 欧美日韩福利视频 | 国产高清视频一区 | 黄色大全免费看 | 成人在线免费网站 |