Skip to content

Commit 63ac064

Browse files
committed
Merge pull request axios#85 from tomaash/patch-1
In browsers check for XMLHttpRequest, not window
2 parents 183e592 + 72fc02f commit 63ac064

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/dispatchRequest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = function dispatchRequest(config) {
1111
return new Promise(function (resolve, reject) {
1212
try {
1313
// For browsers use XHR adapter
14-
if (typeof window !== 'undefined') {
14+
if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {
1515
require('../adapters/xhr')(resolve, reject, config);
1616
}
1717
// For node use HTTP adapter

0 commit comments

Comments
 (0)