Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Some people reported that it doesn't work in IExplorer 8/9. After doing some more testing I quickly came to the conclusion that this is because XDomainRequest simply sucks the life out of you with (1) too many restrictions + (2) no way of debugging whatever happened.
Here's the MSDN page describing current issues with XDomainRequest:
XDomainRequest Restrictions, Limitations and Workarounds
Summarized in the context of our use-case, when doing requests using this utility / debugging / testing it, do the following:
- IExplorer does not accept a wildcard for Access-Control-Allow-Origin
- related to the item above, IExplorer sometimes is configured (or is blocked by a firewall) to NOT send the HTTP Referer. So do NOT base your server-side implementation on it to emulate wildcards
- do not try to send custom headers, IExplorer will ignore them ... so NO
- do not try to send cookies, IExplorer will strip them out and sending cookies is problematic in GENERAL, unless withCredentials is involved
- fresh installs of IExplorer 6 and 7 do not have Flash 9 installed, so flXHR will not work
- in IExplorer 8 (at least originally, I don't know if it wasn't updated), the only Content-Type supported for your request is text/plain. This means the server may not receive a Content-Type: www-urlencoded header in the request and may assume it must not parse it, so do tests and be prepared to parse the request yourself. So do not rely on multipart/form-data to work either. Yes I know, this sucks.