2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Move window defined check before window.XMLHttpRequest check

This commit is contained in:
Andrew J. Pierce
2017-11-02 18:47:24 -04:00
parent 1ee5494038
commit 468e90993d
+2 -2
View File
@@ -24,9 +24,9 @@ module.exports = function xhrAdapter(config) {
// For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers.
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
if (!window.XMLHttpRequest &&
process.env.NODE_ENV !== 'test' &&
if (process.env.NODE_ENV !== 'test' &&
typeof window !== 'undefined' &&
!window.XMLHttpRequest &&
window.XDomainRequest && !('withCredentials' in request) &&
!isURLSameOrigin(config.url)) {
request = new window.XDomainRequest();