Why are CORS requests failing in Microsoft Edge but working in other browsers?

时间秒杀一切 提交于 2019-11-28 06:33:56

I'll include below, verbatim, the answers that Eric Lawrence (creator of Fiddler) kindly provided on the Fiddler forum:

One possibility is that your computer is configured with an Intranet zone and that Intranet zone is dependent on a proxy configuration script: http://blogs.msdn.com/b/ieinternals/archive/2012/06/05/the-local-intranet-security-zone.aspx. When Fiddler is running, the proxy settings are pointed at Fiddler itself.

... there's another factor at work here if you're using an Intranet site as the target of an XHR from a site in the Internet zone.

Edge runs in Enhanced Protected Mode (AppContainer). That has a feature which blocks access to Private Network Resources from Internet-Zone processes. See the "Private Network resources" section of http://blogs.msdn.com/b/ieinternals/archive/2012/03/23/understanding-ie10-enhanced-protected-mode-network-security-addons-cookies-metro-desktop.aspx for more details.

I added local.myapp.test (the URL I'm running my SPA from) to the Local Intranet zone in Internet Options and now Edge is happy without the need for Fiddler.

I came across this question, and after trying several options, what worked for me was removing the domain I am working from all the Zone site entries. Using local.myapp.test as an example, I checked for any "anysubdomain".myapp.test, entries and removed them from all zones, including all sub domains or wild card entries.

In Internet Options (IE 11) , select security tab, and in "Local intranet" click "sites" then "Advanced" and removed relevant domain references in there.

In "Trusted sites" click "sites" and removed relevant entries from the list in there

In about:flags inside of Edge make sure that "Allow localhost loopback (this might put your device at risk) " is checked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!