Search code examples
ajaxxmlhttprequest

302 redirect to a different domain fails silently


I have this peculiar flow.

  1. I make an XMLHttpRequest to my server
  2. My server sends a 302 redirect to a different domain. The server at that domain is CORS compliant.
  3. The browser possibly follows the Location. I don't know what exactly happens here because this request doesn't surface in Chrome's debugging tools.
  4. Finally I am left with an awkward looking request/response in chrome debugger.

Has someone been able to achieve response from cross domain redirection via XMLHttpRequest, or is it even possible?


Solution

  • 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.