Merge pull request #189 from dnf/master
Added protection against multiple callback invocation on error path
This commit is contained in:
commit
edb8a4c18e
|
@ -405,8 +405,10 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
|
|||
});
|
||||
|
||||
request.on("error", function(err) {
|
||||
callbackCalled= true;
|
||||
callback( err )
|
||||
if(!callbackCalled) {
|
||||
callbackCalled= true;
|
||||
callback( err )
|
||||
}
|
||||
});
|
||||
|
||||
if( (method == "POST" || method =="PUT") && post_body != null && post_body != "" ) {
|
||||
|
|
Loading…
Reference in New Issue