Skip to content

Commit 7dc5009

Browse files
author
James Halliday
committed
1.4.0
2 parents 399bfc8 + a5a6ae9 commit 7dc5009

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/request.js

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ var Request = module.exports = function (xhr, params) {
5858
});
5959

6060
xhr.onreadystatechange = function () {
61+
// Fix for IE9 bug
62+
// SCRIPT575: Could not complete the operation due to error c00c023f
63+
// It happens when a request is aborted, calling the success callback anyway with readyState === 4
64+
if (xhr.__aborted) return;
6165
res.handle(xhr);
6266
};
6367
};
@@ -81,6 +85,7 @@ Request.prototype.write = function (s) {
8185
};
8286

8387
Request.prototype.destroy = function (s) {
88+
this.xhr.__aborted = true;
8489
this.xhr.abort();
8590
this.emit('close');
8691
};

0 commit comments

Comments
 (0)