Compatibility with node 0.3.8
This commit is contained in:
committed by
ciaranj
parent
0a786bdcbc
commit
98e432b431
@ -289,12 +289,12 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
||||
if( callback ) {
|
||||
var data="";
|
||||
var self= this;
|
||||
request.addListener('response', function (response) {
|
||||
request.on('response', function (response) {
|
||||
response.setEncoding('utf8');
|
||||
response.addListener('data', function (chunk) {
|
||||
response.on('data', function (chunk) {
|
||||
data+=chunk;
|
||||
});
|
||||
response.addListener('end', function () {
|
||||
response.on('end', function () {
|
||||
if( response.statusCode != 200 ) {
|
||||
callback({ statusCode: response.statusCode, data: data });
|
||||
} else {
|
||||
@ -303,7 +303,7 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
||||
});
|
||||
});
|
||||
|
||||
request.socket.addListener("error",callback);
|
||||
request.on("error", callback);
|
||||
|
||||
if( (method == "POST" || method =="PUT") && post_body != null && post_body != "" ) {
|
||||
request.write(post_body);
|
||||
|
Reference in New Issue
Block a user