Reputation: 4167
I have this peculiar flow.
XMLHttpRequest
to my server302
redirect to a different domain. The server at that domain is CORS
compliant.Location
. I don't know what exactly happens here because this request doesn't surface in Chrome's debugging tools.Has someone been able to achieve response from cross domain redirection via XMLHttpRequest, or is it even possible?
Upvotes: 3
Views: 2315
Reputation: 93551
It is possible, but can only be solved on the server.
Rather than redirect (return a 302 to the client), you need to make the request from your server to the other website and return its response to the client. Basically pass the incoming stream from the other server back as your data stream.
This avoid any cross-domain security problems.
Upvotes: 0
Reputation: 4167
Browsers transparently follows 302
redirects and it doesn't even show up in chrome debugging tools. At the moment there is no way around it. I debugged the http call from curl
.
Upvotes: 2