Merge pull request #140 from AndrewMartens/master
Set default User-Agent if not otherwise specified in customHeaders
This commit is contained in:
@ -74,6 +74,10 @@ exports.OAuth2.prototype._request= function(method, url, headers, post_body, acc
|
||||
}
|
||||
realHeaders['Host']= parsedUrl.host;
|
||||
|
||||
if (!realHeaders['User-Agent']) {
|
||||
realHeaders['User-Agent'] = 'Node-oauth';
|
||||
}
|
||||
|
||||
realHeaders['Content-Length']= post_body ? Buffer.byteLength(post_body) : 0;
|
||||
if( access_token && !('Authorization' in realHeaders)) {
|
||||
if( ! parsedUrl.query ) parsedUrl.query= {};
|
||||
|
Reference in New Issue
Block a user