From 62a3051c204b856624722fc80cce80f8fa135169 Mon Sep 17 00:00:00 2001 From: Carlos Fuentes Date: Fri, 27 Oct 2023 23:28:32 +0200 Subject: [PATCH] refactor: reduce magic --- lib/handler/RetryHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/handler/RetryHandler.js b/lib/handler/RetryHandler.js index 37aca5911a4..de4463b6b9c 100644 --- a/lib/handler/RetryHandler.js +++ b/lib/handler/RetryHandler.js @@ -183,12 +183,12 @@ class RetryHandler { return true } - let contentRange + const contentRange = parseRangeHeader(headers['content-range']) if ( // Let's start with a weak etag check (this.etag != null && this.etag !== headers.etag) || // If no content range - !(contentRange = parseRangeHeader(headers['content-range'])) + !contentRange ) { this.abort(err) return false