Skip to content

Commit

Permalink
Merge remote-tracking branch 'chrischw/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranj committed Jul 28, 2012
2 parents 9db8350 + 5fab3c5 commit d43a712
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exports.OAuth= function(requestUrl, accessUrl, consumerKey, consumerSecret, vers
"User-Agent" : "Node authentication"}
this._clientOptions= this._defaultClientOptions= {"requestTokenHttpMethod": "POST",
"accessTokenHttpMethod": "POST"};
this._oauthParameterSeperator = ",";
};

exports.OAuthEcho= function(realm, verify_credentials, consumerKey, consumerSecret, version, signatureMethod, nonceSize, customHeaders) {
Expand All @@ -48,6 +49,7 @@ exports.OAuthEcho= function(realm, verify_credentials, consumerKey, consumerSecr
this._headers= customHeaders || {"Accept" : "*/*",
"Connection" : "close",
"User-Agent" : "Node authentication"};
this._oauthParameterSeperator = ",";
}

exports.OAuthEcho.prototype = exports.OAuth.prototype;
Expand Down Expand Up @@ -118,11 +120,11 @@ exports.OAuth.prototype._buildAuthorizationHeaders= function(orderedParameters)
// Whilst the all the parameters should be included within the signature, only the oauth_ arguments
// should appear within the authorization header.
if( this._isParameterNameAnOAuthParameter(orderedParameters[i][0]) ) {
authHeader+= "" + this._encodeData(orderedParameters[i][0])+"=\""+ this._encodeData(orderedParameters[i][1])+"\",";
authHeader+= "" + this._encodeData(orderedParameters[i][0])+"=\""+ this._encodeData(orderedParameters[i][1])+"\""+ this._oauthParameterSeperator;
}
}

authHeader= authHeader.substring(0, authHeader.length-1);
authHeader= authHeader.substring(0, authHeader.length-this._oauthParameterSeperator.length);
return authHeader;
}

Expand Down

0 comments on commit d43a712

Please sign in to comment.