2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

Gettings tests passing for IE9

This commit is contained in:
Matt Zabriskie
2016-03-09 16:17:10 -07:00
parent dcbb352262
commit 4d2f9c21d4
4 changed files with 19 additions and 5 deletions
+2 -1
View File
@@ -21,7 +21,8 @@ module.exports = function xhrAdapter(resolve, reject, config) {
// For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers.
if (window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
if (process.env.NODE_ENV !== 'test' && window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
request = new window.XDomainRequest();
loadEvent = 'onload';
xDomain = true;