mirror of
https://github.com/tenrok/axios.git
synced 2026-06-02 16:04:10 +03:00
Only set empty handlers for IE CORS support if using XDomainRequest
This commit is contained in:
+2
-4
@@ -27,6 +27,8 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
request = new window.XDomainRequest();
|
||||
loadEvent = 'onload';
|
||||
xDomain = true;
|
||||
request.onprogress = function handleProgress() {};
|
||||
request.ontimeout = function handleTimeout() {};
|
||||
}
|
||||
|
||||
// HTTP basic authentication
|
||||
@@ -41,10 +43,6 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
// Set the request timeout in MS
|
||||
request.timeout = config.timeout;
|
||||
|
||||
// For IE 9 CORS support.
|
||||
request.onprogress = function handleProgress() {};
|
||||
request.ontimeout = function handleTimeout() {};
|
||||
|
||||
// Listen for ready state
|
||||
request[loadEvent] = function handleLoad() {
|
||||
if (!request || (request.readyState !== 4 && !xDomain)) {
|
||||
|
||||
Reference in New Issue
Block a user