Clear pending queue before stopping on 404
When flush receives a 404, stop() would re-flush remaining pending cookies to a dead endpoint. Clear the queue first to avoid the wasted request. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -143,6 +143,7 @@ export class CookieDetector {
|
|||||||
body: { cookies: entries },
|
body: { cookies: entries },
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
if (err instanceof NotFoundError) {
|
if (err instanceof NotFoundError) {
|
||||||
|
this.pending.clear();
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user