Added protection against multiple callback invocation on error path
This commit is contained in:
parent
324f6d69da
commit
54b958436a
@ -405,8 +405,10 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
|||||||
});
|
});
|
||||||
|
|
||||||
request.on("error", function(err) {
|
request.on("error", function(err) {
|
||||||
|
if(!callbackCalled) {
|
||||||
callbackCalled= true;
|
callbackCalled= true;
|
||||||
callback( err )
|
callback( err )
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if( (method == "POST" || method =="PUT") && post_body != null && post_body != "" ) {
|
if( (method == "POST" || method =="PUT") && post_body != null && post_body != "" ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user