Skip to content
Browse files

Merge pull request #375 from jplock/oauth_timestamp_fix

Fix for missing oauth_timestamp parameter
  • Loading branch information...
2 parents 82d3cb1 + 8c3e9cb commit e6c7aa53b1b03977bfd9570390f11338cf4bd7dc @mikeal mikeal committed Nov 20, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 main.js
View
6 main.js
@@ -876,7 +876,8 @@ Request.prototype.oauth = function (_oauth) {
delete oa.oauth_consumer_secret
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
-
+ var timestamp = oa.oauth_timestamp
+
var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname
var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret)
@@ -889,7 +890,8 @@ Request.prototype.oauth = function (_oauth) {
if (i !== 'x_auth_mode') delete oa[i]
}
}
- this.headers.Authorization =
+ oa.oauth_timestamp = timestamp
+ this.headers.Authorization =
'OAuth '+Object.keys(oa).sort().map(function (i) {return i+'="'+oauth.rfc3986(oa[i])+'"'}).join(',')
this.headers.Authorization += ',oauth_signature="' + oauth.rfc3986(signature) + '"'
return this

0 comments on commit e6c7aa5

Please sign in to comment.
Something went wrong with that request. Please try again.