2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Merge pull request #313 from icracked/master

Only set empty handlers for IE CORS support if using XDomainRequest
This commit is contained in:
Nick Uraltsev
2016-05-03 22:40:39 -07:00
+2 -4
View File
@@ -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)) {