Comparing version 2.76.0 to 2.77.0
## Change Log | ||
### v2.77.0 (2016/11/03) | ||
- [#2439](https://github.com/request/request/pull/2439) Fix socket 'connect' listener handling (@mscdex) | ||
- [#2442](https://github.com/request/request/pull/2442) 👻😱 Node.js 0.10 is unmaintained 😱👻 (@greenkeeperio-bot) | ||
- [#2435](https://github.com/request/request/pull/2435) Add followOriginalHttpMethod to redirect to original HTTP method (@kirrg001) | ||
- [#2414](https://github.com/request/request/pull/2414) Improve test-timeout reliability (@mscdex) | ||
### v2.76.0 (2016/10/25) | ||
@@ -510,4 +516,2 @@ - [#2424](https://github.com/request/request/pull/2424) Handle buffers directly instead of using "bl" (@zertosh) | ||
- [#619](https://github.com/request/request/pull/619) decouple things a bit (@joaojeronimo) | ||
### v2.26.0 (2013/08/07) | ||
- [#613](https://github.com/request/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander) | ||
@@ -514,0 +518,0 @@ - [#605](https://github.com/request/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker) |
@@ -11,2 +11,3 @@ 'use strict' | ||
this.followAllRedirects = false | ||
this.followOriginalHttpMethod = false | ||
this.allowRedirect = function () {return true} | ||
@@ -40,2 +41,5 @@ this.maxRedirects = 10 | ||
} | ||
if (options.followOriginalHttpMethod !== undefined) { | ||
self.followOriginalHttpMethod = options.followOriginalHttpMethod | ||
} | ||
} | ||
@@ -120,3 +124,3 @@ | ||
&& response.statusCode !== 401 && response.statusCode !== 307) { | ||
request.method = 'GET' | ||
request.method = self.followOriginalHttpMethod ? request.method : 'GET' | ||
} | ||
@@ -123,0 +127,0 @@ // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "2.76.0", | ||
"version": "2.77.0", | ||
"author": "Mikeal Rogers <mikeal.rogers@gmail.com>", | ||
@@ -22,3 +22,3 @@ "repository": { | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"node": ">= 4" | ||
}, | ||
@@ -25,0 +25,0 @@ "main": "index.js", |
@@ -765,2 +765,3 @@ | ||
- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`) | ||
- `followOriginalHttpMethod` - by default we redirect to HTTP method GET. you can enable this property to redirect to the original HTTP method (default: `false`) | ||
- `maxRedirects` - the maximum number of redirects to follow (default: `10`) | ||
@@ -767,0 +768,0 @@ - `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain. |
@@ -769,4 +769,11 @@ 'use strict' | ||
self.req.on('socket', function(socket) { | ||
if (timeout !== undefined) { | ||
socket.once('connect', function() { | ||
// `._connecting` was the old property which was made public in node v6.1.0 | ||
var isConnecting = socket._connecting || socket.connecting | ||
// Only start the connection timer if we're actually connecting a new | ||
// socket, otherwise if we're already connected (because this is a | ||
// keep-alive connection) do not bother. This is important since we won't | ||
// get a 'connect' event for an already connected socket. | ||
if (timeout !== undefined && isConnecting) { | ||
var onReqSockConnect = function() { | ||
socket.removeListener('connect', onReqSockConnect) | ||
clearTimeout(self.timeoutTimer) | ||
@@ -789,2 +796,8 @@ self.timeoutTimer = null | ||
}) | ||
} | ||
socket.on('connect', onReqSockConnect) | ||
self.req.on('error', function(err) { | ||
socket.removeListener('connect', onReqSockConnect) | ||
}) | ||
@@ -797,2 +810,3 @@ | ||
self.timeoutTimer = setTimeout(function () { | ||
socket.removeListener('connect', onReqSockConnect) | ||
self.abort() | ||
@@ -799,0 +813,0 @@ var e = new Error('ETIMEDOUT') |
Sorry, the diff of this file is not supported yet
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
198254
2400
1099