diff --git a/lib/oauth.js b/lib/oauth.js index 49c5b50..c705fe3 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -195,7 +195,7 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke oauthProvider= this._createClient(parsedUrl.port, parsedUrl.hostname); } - var headers= {} + var headers= {}; // build request authorization header var authHeader="OAuth "; @@ -212,7 +212,9 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke headers["Host"] = parsedUrl.host for( var key in this._headers ) { - headers[key]= this._headers[key]; + if (this._headers.hasOwnProperty(key)) { + headers[key]= this._headers[key]; + } } headers["Content-length"]= post_body ? post_body.length : 0; //Probably going to fail if not posting ascii