2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-11 18:02:32 +03:00

Merge pull request #85 from tomaash/patch-1

In browsers check for XMLHttpRequest, not window
This commit is contained in:
Matt Zabriskie
2015-07-23 09:07:24 -07:00
+1 -1
View File
@@ -11,7 +11,7 @@ module.exports = function dispatchRequest(config) {
return new Promise(function (resolve, reject) {
try {
// For browsers use XHR adapter
if (typeof window !== 'undefined') {
if ((typeof XMLHttpRequest !== 'undefined') || (typeof ActiveXObject !== 'undefined')) {
require('../adapters/xhr')(resolve, reject, config);
}
// For node use HTTP adapter