Skip to content

Commit

Permalink
Merge pull request #1160 from owap/undefined-window
Browse files Browse the repository at this point in the history
Move window defined check before window.XMLHttpRequest check
  • Loading branch information
nickuraltsev committed Nov 11, 2017
2 parents 026db21 + 468e909 commit 1fa01fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/adapters/xhr.js
Expand Up @@ -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();
Expand Down

0 comments on commit 1fa01fd

Please sign in to comment.