From 84e85f0e85527df70d261bda7c91ee0a8c60614d Mon Sep 17 00:00:00 2001 From: ybouane Date: Wed, 9 Oct 2024 14:44:26 -0400 Subject: [PATCH] Bug correction, signal should be set within the fetch options. (before endpoint.request to allow overwriting it) --- watcher.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/watcher.js b/watcher.js index c90d28b..ce4cc62 100644 --- a/watcher.js +++ b/watcher.js @@ -71,7 +71,10 @@ while(true) { try { performance.clearResourceTimings(); start = performance.now(); - let response = await fetch(endpoint.url, endpoint.request, { signal: AbortSignal.timeout(config.timeout) }); + let response = await fetch(endpoint.url, { + signal: AbortSignal.timeout(config.timeout), + ...endpoint.request, + }); let content = await response.text(); await delay(0); // Ensures that the entry was registered. let perf = performance.getEntriesByType('resource')[0];