From bd54d3f89951f438b41a3e5f56e97145d597d030 Mon Sep 17 00:00:00 2001 From: James Cooper Date: Sat, 30 Oct 2010 11:57:44 -0700 Subject: [PATCH] add scope as an allowed oauth param so we can support google --- lib/oauth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/oauth.js b/lib/oauth.js index 671462f..c1a7214 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -202,7 +202,7 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke for( var i= 0 ; i < orderedParameters.length; i++) { // Whilst the all the parameters should be included within the signature, only the oauth_ arguments // should appear within the authorization header. - if( orderedParameters[i][0].match('^oauth_') == "oauth_") { + if( orderedParameters[i][0].match('^oauth_') == "oauth_" || orderedParameters[i][0] === 'scope') { authHeader+= this._encodeData(orderedParameters[i][0])+"=\""+ this._encodeData(orderedParameters[i][1])+"\","; } } @@ -224,7 +224,7 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke if( !parsedUrl.pathname || parsedUrl.pathname == "" ) parsedUrl.pathname ="/"; if( parsedUrl.query ) path= parsedUrl.pathname + "?"+ parsedUrl.query ; else path= parsedUrl.pathname; - + var request = oauthProvider.request(method, path , headers); if( callback ) { var data=""; @@ -312,7 +312,7 @@ exports.OAuth.prototype.getOAuthRequestToken= function(extraParams, callback) { // Callbacks are 1.0A related if( this._authorize_callback ) { extraParams["oauth_callback"]= this._authorize_callback; - } + } this._performSecureRequest( null, null, "POST", this._requestUrl, extraParams, "", null, function(error, data, response) { if( error ) callback(error); else {