Permalink
Browse files

Merge pull request #263 from nanodocumet/master

Bug in OAuth key generation for sha1
  • Loading branch information...
2 parents 5f1133a + 914a723 commit 5027141ce1f0747d40216b479777038fe633fd07 @mikeal mikeal committed Jun 8, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 oauth.js
View
4 oauth.js
@@ -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)
}

0 comments on commit 5027141

Please sign in to comment.