fix(http): avoid abort a request when fetch operation is completed (#37367)

`abort` method is calling, even if fetch operation is completed

Fixes https://github.com/angular/angular/issues/36537

PR Close #37367
This commit is contained in:
Dmitrij Kuba
2020-05-31 17:32:21 +03:00
committed by Andrew Kushnir
parent ef1fb6dee4
commit 8a74508130
2 changed files with 14 additions and 1 deletions

View File

@ -339,7 +339,9 @@ export class HttpXhrBackend implements HttpBackend {
}
// Finally, abort the in-flight request.
xhr.abort();
if (xhr.readyState !== xhr.DONE) {
xhr.abort();
}
};
});
}