From 80173a208ac0dd068d37aaeeb4010bf2bb27168c Mon Sep 17 00:00:00 2001 From: Ashley Romualdo Date: Mon, 10 Oct 2016 11:28:11 -0500 Subject: [PATCH] Adding all 2xx status codes to success for doPost. --- lib/Twitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Twitter.js b/lib/Twitter.js index 2da39bc..c6d8a22 100644 --- a/lib/Twitter.js +++ b/lib/Twitter.js @@ -211,7 +211,7 @@ Twitter.prototype.doPost = function (url, post_body, error, success) { //(url, oauth_token, oauth_token_secret, post_body, post_content_type, callback this.oauth.post(url, this.accessToken, this.accessTokenSecret, post_body, "application/x-www-form-urlencoded", function (err, body, response) { if (DEBUG) console.log('URL [%s]', url); - if (!err && response.statusCode == 200) { + if (!err && response.statusCode >= 200 && response.statusCode < 300) { success(body); } else { error(err, response, body);