From e452f761f7c9edbd9e4e73493373f427b0fb5141 Mon Sep 17 00:00:00 2001 From: Tim Garthwaite Date: Thu, 11 Jan 2018 10:44:40 -0500 Subject: [PATCH] Don't set maxBodyLength in follow-redirects if maxContentLength is -1 --- lib/adapters/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/adapters/http.js b/lib/adapters/http.js index 22b9878..ce9137f 100644 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -128,7 +128,7 @@ module.exports = function httpAdapter(config) { transport = isHttps ? httpsFollow : httpFollow; } - if (config.maxContentLength) { + if (config.maxContentLength && maxBodyLength > -1) { options.maxBodyLength = config.maxContentLength; }