Microsoft Edge阻止发送到同一专用网络CIDR中的IP的跨域请求 [英] Microsoft Edge blocked cross-domain requests sent to IPs in same private network CIDR
问题描述
$.ajax({
url: "http://10.13.22.150/req_path",
success: function(result){
console.log(result);
}
});
我想将跨域XMLHttpRequest发送到私有网络中的IP地址。
但是,开发人员工具控制台中显示以下错误:
I'd like to send Cross-Domain XMLHttpRequest to ip addresses in the private network. However, the following error is shown in developer tools console:
SCRIPT7002:XMLHttpRequest:网络错误0x2efd,无法完成操作由于错误00002efd。
SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd.
根据Wireshark,数据包不是从客户端发送的。我想这个请求被Microsoft Edge阻止
此外,我发现只有XMLHttpRequest和Edge客户端的URL位于私有网络的相同CIDR中时才会阻止请求。
According to Wireshark, the packet is not sent from client side. I guess the request is blocked by Microsoft Edge Furthermore, I found that the requests are only blocked if the url of XMLHttpRequest and Edge client are in the same CIDR of private network.
Client IP Request URL Result
192.168.x.x send to 192.168.x.x ->>>>> X
10.13.x.x send to 10.13.x.x ->>>>> X
10.13.x.x send to 192.168.x.x ->>>>> O
其他浏览器,如IE11 / Chrome / Firefox,此情况仅在Microsoft Edge中显示。
有关此问题的任何解决方法或解决方案吗?
Other browsers like IE11 / Chrome / Firefox work just fine. This circumstance is only shown in Microsoft Edge. Is there any workaround or solution about this issue?
推荐答案
私人网络资源
由于EPM不声明privateNetworkClientServer功能,因此您的Intranet资源受到保护,免受多种类型的跨域攻击(通常称为跨站点请求伪造(CSRF)和内部网端口扫描。)Internet页面无法构建Intranet页面,从中加载图片或资源,向他们发送CORS XHR请求等。
Because EPM does not declare the privateNetworkClientServer capability, your Intranet resources are protected from many types of cross-zone attacks (usually called "Cross-Site-Request-Forgery (CSRF)" and "Intranet Port Scanning.") Internet pages are not able to frame Intranet pages, load images or resources from them, send them CORS XHR requests, etc.
以应用于MS Edge。唯一缺少Edge(至少在这一点,v20.10240)是安全区域设置。
All of the above seems to apply to MS Edge. The only thing Edge is lacking (at least at this point, v20.10240) is the security zone settings.
我的问题不是与XMLHttpRequest,而是与尝试在互联网页面内的iframe中加载Intranet页面。解决方法包括调整网络设置 - 请参阅 http://stackoverflow.com/a/32828629
My issue wasn't with the XMLHttpRequest but rather with trying to load an intranet page in an iframe inside the internet page. The workaround involved chanding my network setup - see http://stackoverflow.com/a/32828629
这篇关于Microsoft Edge阻止发送到同一专用网络CIDR中的IP的跨域请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!