Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack to support Google's scope param #10

Merged
1 commit merged into from
Oct 31, 2010
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])+"\",";
}
}
Expand All @@ -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="";
Expand Down Expand Up @@ -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 {
Expand Down