Added an extra test, and checked realHeaders to catch any dodgy custom ones

This commit is contained in:
ciaranj
2013-03-05 18:07:40 +00:00
parent 8be23c309c
commit 301ebab90c
2 changed files with 16 additions and 5 deletions

View File

@ -75,7 +75,7 @@ exports.OAuth2.prototype._request= function(method, url, headers, post_body, acc
realHeaders['Host']= parsedUrl.host;
realHeaders['Content-Length']= post_body ? Buffer.byteLength(post_body) : 0;
if( access_token && !('Authorization' in headers)) {
if( access_token && !('Authorization' in realHeaders)) {
if( ! parsedUrl.query ) parsedUrl.query= {};
parsedUrl.query[this._accessTokenName]= access_token;
}