Skip to content

Commit

Permalink
Add 'forever' as an option to RequestClient request method. (twilio#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhidal authored and dkundel committed Jan 29, 2018
1 parent ae573f0 commit a1e0e79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/base/RequestClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var RequestClient = function() {};
* @param {object} [opts.data] - The request data
* @param {int} [opts.timeout=30000] - The request timeout in milliseconds
* @param {boolean} [opts.allowRedirects] - Should the client follow redirects
* @param {boolean} [opts.forever] - Set to true to use the forever-agent
*/
RequestClient.prototype.request = function(opts) {
opts = opts || {};
Expand All @@ -44,7 +45,7 @@ RequestClient.prototype.request = function(opts) {
url: opts.uri,
method: opts.method,
headers: opts.headers,
forever: true,
forever: opts.forever === false ? false : true,
};

if (!_.isNull(opts.data)) {
Expand Down

0 comments on commit a1e0e79

Please sign in to comment.