follow-redirects 1.5.4 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of follow-redirects might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +4 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -155,10 +155,11 @@ RedirectableRequest.prototype._performRequest = function () {
155
155
  // (The first request must be ended explicitly with RedirectableRequest#end)
156
156
  if (this._isRedirect) {
157
157
  // Write the request entity and end.
158
- var requestBodyBuffers = this._requestBodyBuffers;
158
+ var i = 0;
159
+ var buffers = this._requestBodyBuffers;
159
160
  (function writeNext() {
160
- if (requestBodyBuffers.length !== 0) {
161
- var buffer = requestBodyBuffers.shift();
161
+ if (i < buffers.length) {
162
+ var buffer = buffers[i++];
162
163
  request.write(buffer.data, buffer.encoding, writeNext);
163
164
  }
164
165
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "follow-redirects",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "HTTP and HTTPS modules that follow redirects.",
5
5
  "main": "index.js",
6
6
  "engines": {