wreck
Advanced tools
Comparing version 12.3.0 to 12.4.0
@@ -109,2 +109,5 @@ 'use strict'; | ||
Hoek.assert(options.onRequest === undefined || typeof options.onRequest === 'function', | ||
'options.onRequest must be a function'); | ||
options.beforeRedirect = options.beforeRedirect || ((redirectMethod, statusCode, location, resHeaders, redirectOptions, next) => next()); | ||
@@ -297,2 +300,7 @@ | ||
stream.pipe(req); | ||
if (options.onRequest) { | ||
options.onRequest(req); | ||
} | ||
return req; | ||
@@ -308,2 +316,6 @@ } | ||
if (options.onRequest) { | ||
options.onRequest(req); | ||
} | ||
return req; | ||
@@ -310,0 +322,0 @@ }; |
{ | ||
"name": "wreck", | ||
"description": "HTTP Client Utilities", | ||
"version": "12.3.0", | ||
"version": "12.4.0", | ||
"repository": "git://github.com/hapijs/wreck", | ||
@@ -6,0 +6,0 @@ "main": "lib/index", |
@@ -118,2 +118,3 @@ ![wreck Logo](https://raw.github.com/hapijs/wreck/master/images/wreck.png) | ||
- `headers` - An object containing request headers. | ||
- `onRequest` - A function that is called when a request is available using the signature `function(req)` where `req` is a [ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest). | ||
- `redirects` - The maximum number of redirects to follow. | ||
@@ -120,0 +121,0 @@ - `redirect303` - if `true`, a HTTP 303 status code will redirect using a GET method. Defaults to no redirection on 303. |
43566
500
386