Match all 2xx response codes.
This commit is contained in:
parent
dfe4c02ff1
commit
c78a9ca129
@ -350,7 +350,7 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
||||
data+=chunk;
|
||||
});
|
||||
response.on('end', function () {
|
||||
if( response.statusCode != 200 ) {
|
||||
if (!( response.statusCode >= 200 && response.statusCode <= 299 )) {
|
||||
// Follow 302 redirects with Location HTTP header
|
||||
if(response.statusCode == 302 && response.headers && response.headers.location) {
|
||||
self._performSecureRequest( oauth_token, oauth_token_secret, method, response.headers.location, extra_params, post_body, post_content_type, callback);
|
||||
|
Loading…
x
Reference in New Issue
Block a user