Closed stevenvachon closed 7 years ago
@feross
Some code golf to get <100 :)
- if (opts.maxRedirects > 0) {
- opts.redirectHistory.push(res)
- simpleGet(opts, cb)
- } else {
- cb(new Error('too many redirects'))
- }
+ if (opts.maxRedirects < 1) return cb(new Error('too many redirects'))
+ opts.redirectHistory.push(res)
+ simpleGet(opts, cb)
fixes #23