Skip to content

Commit

Permalink
Merge pull request #1287 from mividtim/mividtim/follow-redirects-max-…
Browse files Browse the repository at this point in the history
…length

Set maxBodyLength on follow-redirects to match maxContentLength on AxiosOptions
  • Loading branch information
emilyemorehouse committed Feb 11, 2018
2 parents 14057dc + 89bf42b commit f26e0c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/adapters/http.js
Expand Up @@ -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;
Expand Down

0 comments on commit f26e0c0

Please sign in to comment.