From 02733180f097c03676cbaafa9df36f93b0f44e1b Mon Sep 17 00:00:00 2001 From: dusnoki Date: Tue, 23 Feb 2016 17:08:27 +0100 Subject: [PATCH] Accommodate webpack/browserify This needs to be changed in order to Accommodate webpack/browserify when working on local environment. --- lib/oauth.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/oauth.js b/lib/oauth.js index 50dccf99..f800002c 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -401,7 +401,9 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke } request.on('response', function (response) { - response.setEncoding('utf8'); + if (response.setEncoding) { + response.setEncoding('utf8'); + } response.on('data', function (chunk) { data+=chunk; });