From c78a9ca129884a353d0715c3ed11c3f5dc76b765 Mon Sep 17 00:00:00 2001 From: Neil Mansilla Date: Thu, 23 Jun 2011 09:14:46 -0700 Subject: [PATCH] Match all 2xx response codes. --- lib/oauth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oauth.js b/lib/oauth.js index 7630451..958139c 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -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);