From bbfa7bfaccff368dd3666f32fb47773f863ec242 Mon Sep 17 00:00:00 2001 From: Tim Garthwaite Date: Wed, 10 Jan 2018 19:01:56 -0500 Subject: [PATCH] Fixing maxBodyLength exceeded error form follow-redirects when axios's maxContentLength is not exceeded --- lib/adapters/http.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/adapters/http.js b/lib/adapters/http.js index f6d7067..22b9878 100644 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -128,6 +128,10 @@ module.exports = function httpAdapter(config) { transport = isHttps ? httpsFollow : httpFollow; } + if (config.maxContentLength) { + options.maxBodyLength = config.maxContentLength; + } + // Create the request var req = transport.request(options, function handleResponse(res) { if (req.aborted) return;