Skip to content

Commit

Permalink
refactor: reduce magic
Browse files Browse the repository at this point in the history
  • Loading branch information
metcoder95 committed Oct 27, 2023
1 parent d42ed39 commit 62a3051
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/handler/RetryHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 62a3051

Please sign in to comment.