Skip to content

Commit 1fa01fd

Browse files
authored
Merge pull request axios#1160 from owap/undefined-window
Move window defined check before window.XMLHttpRequest check
2 parents 026db21 + 468e909 commit 1fa01fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/adapters/xhr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ module.exports = function xhrAdapter(config) {
2424
// For IE 8/9 CORS support
2525
// Only supports POST and GET calls and doesn't returns the response headers.
2626
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
27-
if (!window.XMLHttpRequest &&
28-
process.env.NODE_ENV !== 'test' &&
27+
if (process.env.NODE_ENV !== 'test' &&
2928
typeof window !== 'undefined' &&
29+
!window.XMLHttpRequest &&
3030
window.XDomainRequest && !('withCredentials' in request) &&
3131
!isURLSameOrigin(config.url)) {
3232
request = new window.XDomainRequest();

0 commit comments

Comments
 (0)