久久久久久久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'>

      拒絕設(shè)置不安全的標(biāo)頭“Origin"使用谷歌瀏覽

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

        • <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>
              • 本文介紹了拒絕設(shè)置不安全的標(biāo)頭“Origin"使用谷歌瀏覽器的 xmlHttpRequest 時(shí)的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                收到此錯(cuò)誤消息:拒絕設(shè)置不安全的標(biāo)頭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);
                
                            }
                        }
                

                我做錯(cuò)了什么?為了使這個(gè) CORS 請求正常工作,我在標(biāo)頭中遺漏了什么?

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

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

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

                為什么?

                推薦答案

                這只是一個(gè)猜測,因?yàn)槲沂褂?jquery 處理 ajax 請求,包括 CORS.

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

                我認(rèn)為瀏覽器應(yīng)該設(shè)置標(biāo)題,而不是你.如果您能夠設(shè)置標(biāo)題,那將破壞安全功能的目的.

                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.

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

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

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

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

                相關(guān)文檔推薦

                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標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                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 部分內(nèi)容)
                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. 主站蜘蛛池模板: 国产乱码精品1区2区3区 | 99精品国自产在线 | 欧美日韩精品一区 | 成人在线观看网站 | 日本aaaa | 日韩视频在线播放 | 亚洲黄色一区二区三区 | 亚洲精品区 | 麻豆视频国产在线观看 | 亚洲a一区 | 欧美一区二区三区四区五区无卡码 | 亚洲第一成人av | www.久| 国产高清免费视频 | 毛片区 | 国产精品视频中文字幕 | 欧美一级在线观看 | 在线观看av网站 | 久草免费电影 | 欧美精三区欧美精三区 | 日韩欧美在线视频播放 | 国产精品毛片 | 一级欧美视频 | 久久国产精品视频免费看 | 色婷婷久久久久swag精品 | 国产美女在线观看 | 国产午夜精品久久久久 | 毛片免费观看视频 | 国产在线中文字幕 | 亚洲综合一区二区三区 | 国产成人a亚洲精品 | 亚洲国产高清在线 | 视频一区二区在线观看 | 伊人一二三 | 国产成人a亚洲精品 | 男人天堂99 | k8久久久一区二区三区 | 久久99视频这里只有精品 | 久久i | 欧美精品久久久久 | 日韩一二三区 |