diff --git a/lib/adapters/http.js b/lib/adapters/http.js index d39a573a2a..e302bc0e46 100755 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -216,6 +216,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)); }