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

后端 未结 3 558
我在风中等你
我在风中等你 2020-12-01 08:36

I\'m using jQuery to send cross origin ajax requests and they\'re working fine in IE11, Chrome and Firefox but they fail in Edge with the following error:

3条回答
  •  抹茶落季
    2020-12-01 09:01

    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.

提交回复
热议问题