Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/xhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ XHookHttpRequest = window[XMLHTTP] = function() {
}
};
readBody = function() {
if (status === ABORTED && msie < 10) {
return;
}
if (!xhr.responseType || xhr.responseType === "text") {
response.text = xhr.responseText;
response.data = xhr.responseText;
Expand Down
2 changes: 1 addition & 1 deletion dist/xhook.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/xhook.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ XHookHttpRequest = window[XMLHTTP] = ->
return

readBody = ->
if status is ABORTED and msie < 10
return
#https://xhr.spec.whatwg.org/
if !xhr.responseType or xhr.responseType is "text"
response.text = xhr.responseText
Expand Down
8 changes: 8 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@ describe('xhook', function() {
};
xhr.send();
});

it('should not fail on aborted request in IE9', function(done) {
var xhr = new XMLHttpRequest();
xhr.open('GET', '../example/example1.txt');
xhr.send();
xhr.abort();
done();
});
});