简体   繁体   English

Firefox中的跨域请求

[英]Cross-domain request in Firefox

I am developing an OpenSocial gadget (JavaScript language) for RQM (Rational Quality Manager) that gets information from DWA (Doors Web Access). 我正在为RQM(Rational Quality Manager)开发一个OpenSocial小工具(JavaScript语言),该工具从DWA(Doors Web Access)获取信息。 The gadget is running on RQM (https://:9443/) and I want to make request to the DWA (https://:8443/). 该小工具正在RQM(https://:9443 /)上运行,我想向DWA(https://:8443 /)发出请求。

The gadget runs correctly in IE, but when I run in Firefox I get the following error: 该小工具可以在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>

What could be the issue and what can I do? 可能是问题所在,我该怎么办? Is there anything I can do on the client side? 在客户端我有什么可以做的吗?

Thanks in advance! 提前致谢!

CORS stands for Cross Domain Resource Sharing. CORS代表跨域资源共享。 Because of the same origin policy you are not allowed to make requests to other URI schemes, port number, hostname etc ( https://en.wikipedia.org/wiki/Same-origin_policy ). 由于具有相同的原始策略,因此您无法向其他URI方案,端口号,主机名等发出请求( https://en.wikipedia.org/wiki/Same-origin_policy )。 You are trying to make a request to another portnumber. 您正在尝试向另一个端口号发出请求。 Solutions to this are CORS, JSONP and web sockets. 解决方案是CORS,JSONP和Web套接字。 But the best thing you could do is use CORS. 但是,您可以做的最好的事情就是使用CORS。 For more information you on how to implement is you can look at http://www.html5rocks.com/en/tutorials/cors/ or https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS 有关如何实施的更多信息,请访问http://www.html5rocks.com/zh_CN/tutorials/cors/https://developer.mozilla.org/zh-CN/docs/Web/HTTP/ Access_control_CORS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM