Skip to content

Commit

Permalink
fix: add status validator to request options so non-2XXs can be wrapp…
Browse files Browse the repository at this point in the history
…ed in a 'RestException' (#547)
  • Loading branch information
childish-sambino authored Mar 18, 2020
1 parent 07891d5 commit 565d8e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/base/RequestClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ RequestClient.prototype.request = function(opts) {
headers: opts.headers,
httpAgent: opts.forever ? new http.Agent({ keepAlive: true }) : undefined,
httpsAgent: opts.forever ? new https.Agent({ keepAlive: true }) : undefined,
validateStatus: status => status >= 100 && status < 600,
};

if (process.env.TWILIO_CA_BUNDLE !== undefined) {
Expand Down

0 comments on commit 565d8e1

Please sign in to comment.