From fedf5776e7eb1cc697cbf0909abc73ab4e8d0cf4 Mon Sep 17 00:00:00 2001 From: Yohei Sasaki Date: Sun, 17 Oct 2010 15:53:29 +0900 Subject: [PATCH] more strict comparison. --- lib/oauth.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/oauth.js b/lib/oauth.js index 90bb4036..6ff3aead 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -76,7 +76,8 @@ exports.OAuth.prototype._buildAuthorizationHeaders= function(orderedParameters) for( var i= 0 ; i < orderedParameters.length; i++) { // Whilst the all the parameters should be included within the signature, only the oauth_ arguments // should appear within the authorization header. - if( orderedParameters[i][0].match('^oauth_') == "oauth_") { + var m = orderedParameters[i][0].match('^oauth_'); + if( m && m[0] === "oauth_") { authHeader+= this._encodeData(orderedParameters[i][0])+"=\""+ this._encodeData(orderedParameters[i][1])+"\","; } }