Edge on Windows 10 32-Bit blocking ajax call to localhost with Network Error 0x2efd

后端 未结 5 1519
耶瑟儿~
耶瑟儿~ 2021-02-07 11:31

We have an app that uses SignalR to talk to scanner drivers locally that has been in production for a couple of years working on IE, Chrome and Firefox, which do not have a prob

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 12:17

    I had the same issue. While Ajax calls to a page on the same domain were working in every other browser, in Edge they wouldn't. Opening the url used for the Ajax call in a different tab would give the correct results. Adding the piece of code to the page serving the Ajax calls fixed it somehow... The code is in C# but maybe this will give a general idea how to fix it in other languages.

        if (Request.UserHostName == "127.0.0.1")
            Response.AppendHeader("Access-Control-Allow-Origin", "*");
    

提交回复
热议问题