mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Merge pull request #1160 from owap/undefined-window
Move window defined check before window.XMLHttpRequest check
This commit is contained in:
+2
-2
@@ -24,9 +24,9 @@ module.exports = function xhrAdapter(config) {
|
|||||||
// For IE 8/9 CORS support
|
// For IE 8/9 CORS support
|
||||||
// Only supports POST and GET calls and doesn't returns the response headers.
|
// 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.
|
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
|
||||||
if (!window.XMLHttpRequest &&
|
if (process.env.NODE_ENV !== 'test' &&
|
||||||
process.env.NODE_ENV !== 'test' &&
|
|
||||||
typeof window !== 'undefined' &&
|
typeof window !== 'undefined' &&
|
||||||
|
!window.XMLHttpRequest &&
|
||||||
window.XDomainRequest && !('withCredentials' in request) &&
|
window.XDomainRequest && !('withCredentials' in request) &&
|
||||||
!isURLSameOrigin(config.url)) {
|
!isURLSameOrigin(config.url)) {
|
||||||
request = new window.XDomainRequest();
|
request = new window.XDomainRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user