follow-redirects
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -64,2 +64,9 @@ var url = require("url"); | ||
} | ||
// Ignore empty buffers, since writing them doesn't invoke the callback | ||
// https://github.com/nodejs/node/issues/22066 | ||
if (data.length === 0) { | ||
callback(); | ||
return; | ||
} | ||
// Only write when we don't exceed the maximum body length | ||
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { | ||
@@ -70,2 +77,3 @@ this._requestBodyLength += data.length; | ||
} | ||
// Error when we exceed the maximum body length | ||
else { | ||
@@ -72,0 +80,0 @@ this.emit("error", new Error("Request body larger than maxBodyLength limit")); |
{ | ||
"name": "follow-redirects", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "HTTP and HTTPS modules that follow redirects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
19118
264