Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 23, 2024
1 parent 3bd3582 commit a76bed3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/handler/redirect-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class RedirectHandler {
this.maxRedirections = maxRedirections
this.handler = handler
this.history = []
this.redirectionLimitReached = false

if (util.isStream(this.opts.body)) {
// TODO (fix): Provide some way for the user to cache the file to e.g. /tmp
Expand Down Expand Up @@ -101,9 +100,7 @@ class RedirectHandler {

onHeaders (statusCode, rawHeaders, resume, statusText) {
if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
this.redirectionLimitReached = true
this.abort(new Error('max redirects'))
return
throw new Error('max redirects')
}

// https://tools.ietf.org/html/rfc7231#section-6.4.2
Expand Down

0 comments on commit a76bed3

Please # to comment.