Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move window defined check before window.XMLHttpRequest check #1160

Merged
merged 1 commit into from Nov 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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