简体   繁体   中英

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). The gadget is running on RQM (https://:9443/) and I want to make request to the DWA (https://:8443/).

The gadget runs correctly in IE, but when I run in Firefox I get the following error:

> 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. 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 ). You are trying to make a request to another portnumber. Solutions to this are CORS, JSONP and web sockets. But the best thing you could do is use 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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