Skip to content

Commit

Permalink
Skip creation of XHR if signal is already aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesplease committed Dec 7, 2017
1 parent 9a7d232 commit 89620fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fetch.js
Expand Up @@ -425,6 +425,10 @@
var request = new Request(input, init)
var xhr = new XMLHttpRequest()

if (request.signal && request.signal.aborted) {
return reject(abortError);
}

xhr.onload = function() {
var options = {
status: xhr.status,
Expand Down

0 comments on commit 89620fb

Please sign in to comment.