From 41c68d278cec0fb7ff2307574053be21ad2d0828 Mon Sep 17 00:00:00 2001 From: olafbuitelaar Date: Thu, 18 Jul 2024 19:09:18 +0200 Subject: [PATCH] Update url_handler.js the timeout should always be cleared even if an error occurred within the promise --- src/fetcher/url_handler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fetcher/url_handler.js b/src/fetcher/url_handler.js index f04a43cb..d6d7f350 100644 --- a/src/fetcher/url_handler.js +++ b/src/fetcher/url_handler.js @@ -66,8 +66,10 @@ async function get(url, options) { ...options, signal: controller.signal, credentials: options.withCredentials ? 'include' : 'omit', + }) + .finally(()=>{ + clearTimeout(timer); }); - clearTimeout(timer); const error = handleError(response); if (error) {