Firefox中的跨域请求

Cross-domain request in Firefox

本文关键字:请求 Firefox      更新时间:2023-09-26

我正在为RQM (Rational Quality Manager)开发一个OpenSocial小工具(JavaScript语言),它从DWA (Doors Web Access)获取信息。小工具在RQM (https://:9443/)上运行,我想向DWA (https://:8443/)发出请求。

这个小工具在IE中正常运行,但当我在Firefox中运行时,我得到以下错误:

> Cross-Origin Request Blocked: The Same Origin Policy disallows reading
> the remote resource at https://<host>:8443/xxxx. (Reason: CORS header
> 'Access-Control-Allow-Origin' missing). <unknown> Cross-Origin Request
> Blocked: The Same Origin Policy disallows reading the remote resource
> at https://<host>:8443/xxxx. (Reason: CORS request failed). <unknown>

可能是什么问题,我能做什么?我能为客户做些什么吗?

提前感谢!

CORS代表跨域资源共享。由于同源策略,您不允许向其他URI方案,端口号,主机名等(https://en.wikipedia.org/wiki/Same-origin_policy)发出请求。您正在尝试向另一个端口号发出请求。解决方案是CORS、JSONP和web套接字。但是你能做的最好的事情就是使用CORS。想了解更多关于如何实现的信息可以访问http://www.html5rocks.com/en/tutorials/cors/或https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS