From e282c5c81508fff21f120b7aca34c2f810f811c8 Mon Sep 17 00:00:00 2001 From: Ulternae Date: Sat, 4 Apr 2026 14:00:49 -0500 Subject: [PATCH] Switch to blob().text() for faster fetch parsing --- src/engines/BandwidthEngine/BandwidthEngine.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/engines/BandwidthEngine/BandwidthEngine.js b/src/engines/BandwidthEngine/BandwidthEngine.js index ea07f70..fac8c7a 100644 --- a/src/engines/BandwidthEngine/BandwidthEngine.js +++ b/src/engines/BandwidthEngine/BandwidthEngine.js @@ -303,15 +303,17 @@ class BandwidthMeasurementEngine { return r; }) .then(r => - r.text().then(body => { - this.#responseHook && - this.#responseHook({ - url, - headers: r.headers, - body + r.blob().then(blob => { + if (this.#responseHook) { + blob.text().then(body => { + this.#responseHook({ + url, + headers: r.headers, + body + }); }); - - return body; + } + return blob; }) ) .then(() => {