diff --git a/lib/adapters/http.js b/lib/adapters/http.js index f6d7067240a7171431d6ec7cc0cf155a105f223b..69e8e7474d7fe9e77e56872b48da7c8694cba11b 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 && config.maxContentLength > -1) { + options.maxBodyLength = config.maxContentLength; + } + // Create the request var req = transport.request(options, function handleResponse(res) { if (req.aborted) return;