diff --git a/lib/adapters/http.js b/lib/adapters/http.js index b986487c62..274e6a102d 100755 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -181,6 +181,7 @@ module.exports = function httpAdapter(config) { // make sure the content length is not over the maxContentLength if specified if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) { + stream.destroy(); reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', config, null, lastRequest)); }