Skip to content

Commit

Permalink
Fix for authHeader not including extra params
Browse files Browse the repository at this point in the history
  • Loading branch information
codersmith committed Aug 24, 2022
1 parent 0749d67 commit d01e45a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,15 @@ exports.OAuth.prototype.signUrl= function(url, oauth_token, oauth_token_secret,
return parsedUrl.protocol + "//"+ parsedUrl.host + parsedUrl.pathname + "?" + query;
};

exports.OAuth.prototype.authHeader= function(url, oauth_token, oauth_token_secret, method) {
exports.OAuth.prototype.authHeader= function(url, oauth_token, oauth_token_secret, method, extra_params) {
if( method === undefined ) {
var method= "GET";
}

var orderedParameters= this._prepareParameters(oauth_token, oauth_token_secret, method, url, {});
if( extra_params === undefined ) {
var extra_params= {};
}

var orderedParameters= this._prepareParameters(oauth_token, oauth_token_secret, method, url, extra_params);
return this._buildAuthorizationHeaders(orderedParameters);
};

0 comments on commit d01e45a

Please sign in to comment.