From 0f78c3470ce133f320212ca2c198d1e03645aebb Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 26 May 2026 19:19:10 +0200 Subject: [PATCH] chore(core): use `regex.exec` instead of `string.match` --- lib/core/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/util.js b/lib/core/util.js index 23e94651562..cb0a64e8c7a 100644 --- a/lib/core/util.js +++ b/lib/core/util.js @@ -792,8 +792,9 @@ const rangeHeaderRegex = /^bytes (\d+)-(\d+)\/(\d+|\*)?$/ */ function parseRangeHeader (range) { if (range == null || range === '') return { start: 0, end: null, size: null } + if (!range) return null - const m = range ? range.match(rangeHeaderRegex) : null + const m = rangeHeaderRegex.exec(range) return m ? { start: parseInt(m[1]),