From 9419b0044108304f8f4744237dbbe9e89fbc59da Mon Sep 17 00:00:00 2001 From: John Baumbach Date: Wed, 8 Oct 2014 18:35:52 +0000 Subject: [PATCH] Fix headers variable in wrong scope in get() --- lib/oauth2.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/oauth2.js b/lib/oauth2.js index a182794..e8a661f 100644 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -193,12 +193,10 @@ exports.OAuth2.prototype.getProtectedResource= function(url, access_token, callb } exports.OAuth2.prototype.get= function(url, access_token, callback) { + var headers= {}; if( this._useAuthorizationHeaderForGET ) { - var headers= {'Authorization': this.buildAuthHeader(access_token) } + headers= {'Authorization': this.buildAuthHeader(access_token) } access_token= null; } - else { - headers= {}; - } this._request("GET", url, headers, "", access_token, callback ); }