Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added an option to change the OAuth parameter seperator

  • Loading branch information...
commit 5fab3c577e4514f9a9280bcc472d7ddb85e7d1eb 1 parent a7c1e94
@problame problame authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/oauth.js
View
6 lib/oauth.js
@@ -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) {
@@ -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;
@@ -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;
}

0 comments on commit 5fab3c5

Please sign in to comment.
Something went wrong with that request. Please try again.