Skip to content

Commit

Permalink
Merge pull request #263 from nanodocumet/master
Browse files Browse the repository at this point in the history
Bug in OAuth key generation for sha1
  • Loading branch information
mikeal committed Jun 8, 2012
2 parents 5f1133a + 914a723 commit 5027141
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret,
// big WTF here with the escape + encoding but it's what twitter wants
return escape(rfc3986(i)) + "%3D" + escape(rfc3986(params[i]))
}).join("%26")
var key = consumer_secret + '&'
if (token_secret) key += token_secret
var key = encodeURIComponent(consumer_secret) + '&'
if (token_secret) key += encodeURIComponent(token_secret)
return sha1(key, base)
}

Expand Down

0 comments on commit 5027141

Please sign in to comment.