2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

Fixed race condition on immediate requests cancellation (#4261)

* Fixes #4260: fixed race condition on immediate requests cancellation

* Update http.js

Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Dmitriy Mozgovoy
2022-05-09 19:12:29 +03:00
committed by GitHub
parent 27280ec260
commit de48c5d626
2 changed files with 30 additions and 3 deletions
+2 -3
View File
@@ -25,10 +25,9 @@ function CancelToken(executor) {
this.promise.then(function(cancel) {
if (!token._listeners) return;
var i;
var l = token._listeners.length;
var i = token._listeners.length;
for (i = 0; i < l; i++) {
while (i-- > 0) {
token._listeners[i](cancel);
}
token._listeners = null;