Bug correction, signal should be set within the fetch options. (before endpoint.request to allow overwriting it)

This commit is contained in:
ybouane 2024-10-09 14:44:26 -04:00
parent a82459000a
commit 84e85f0e85

View file

@ -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];