follow-redirects
Advanced tools
Comparing version 1.2.3 to 1.2.4
15
index.js
@@ -45,2 +45,13 @@ 'use strict'; | ||
// Complete the URL object when necessary | ||
if (!options.pathname && options.path) { | ||
var searchPos = options.path.indexOf('?'); | ||
if (searchPos < 0) { | ||
options.pathname = options.path; | ||
} else { | ||
options.pathname = options.path.substring(0, searchPos); | ||
options.search = options.path.substring(searchPos); | ||
} | ||
} | ||
// Perform the first request | ||
@@ -61,3 +72,3 @@ this._performRequest(); | ||
// Create the native request | ||
var nativeProtocol = nativeProtocols[this._options.protocol]; | ||
var nativeProtocol = nativeProtocols[protocol]; | ||
var request = this._currentRequest = | ||
@@ -187,3 +198,3 @@ nativeProtocol.request(this._options, this._onNativeResponse); | ||
// Writes buffered data to the current native request | ||
RedirectableRequest.prototype._write = function (data, encoding, callback) { | ||
RedirectableRequest.prototype.write = function (data, encoding, callback) { | ||
this._currentRequest.write(data, encoding, callback); | ||
@@ -190,0 +201,0 @@ this._bufferedWrites.push({data: data, encoding: encoding}); |
{ | ||
"name": "follow-redirects", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "HTTP and HTTPS modules that follow redirects.", | ||
"main": "index.js", | ||
"engines": { | ||
"node": ">=4.0" | ||
}, | ||
"scripts": { | ||
@@ -7,0 +10,0 @@ "test": "xo && BLUEBIRD_DEBUG=1 nyc mocha" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16382
213