Browse files

Merge pull request #150 from joserobleda/master

Use hasOwnProperty to prevent erros
  • Loading branch information...
2 parents 4e351fe + 89f7972 commit 0707eb851b22e045d72c7e09b1f0d2b14f4feb4c @ciaranj committed May 21, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/oauth.js
View
4 lib/oauth.js
@@ -140,6 +140,7 @@ exports.OAuth.prototype._buildAuthorizationHeaders= function(orderedParameters)
exports.OAuth.prototype._makeArrayOfArgumentsHash= function(argumentsHash) {
var argument_pairs= [];
for(var key in argumentsHash ) {
+ if (argumentsHash.hasOwnProperty(key)) {
var value= argumentsHash[key];
if( Array.isArray(value) ) {
for(var i=0;i<value.length;i++) {
@@ -149,6 +150,7 @@ exports.OAuth.prototype._makeArrayOfArgumentsHash= function(argumentsHash) {
else {
argument_pairs[argument_pairs.length]= [key, value];
}
+ }
}
return argument_pairs;
}
@@ -274,7 +276,7 @@ exports.OAuth.prototype._prepareParameters= function( oauth_token, oauth_token_s
else {
if( extra_params ) {
for( var key in extra_params ) {
- oauthParameters[key]= extra_params[key];
+ if (extra_params.hasOwnProperty(key)) oauthParameters[key]= extra_params[key];
}
}
var parsedUrl= URL.parse( url, false );

0 comments on commit 0707eb8

Please sign in to comment.