Skip to content

Commit a76bed3

Browse files
committed
fixup
1 parent 3bd3582 commit a76bed3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/handler/redirect-handler.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class RedirectHandler {
4949
this.maxRedirections = maxRedirections
5050
this.handler = handler
5151
this.history = []
52-
this.redirectionLimitReached = false
5352

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

102101
onHeaders (statusCode, rawHeaders, resume, statusText) {
103102
if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) {
104-
this.redirectionLimitReached = true
105-
this.abort(new Error('max redirects'))
106-
return
103+
throw new Error('max redirects')
107104
}
108105

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

0 commit comments

Comments
 (0)