Permalink
Browse files

If one of the request parameters is called "timestamp", the "oauth_ti…

…mestamp" OAuth parameter will get removed during the parameter cleanup loop.
  • Loading branch information...
1 parent 82d3cb1 commit 8c3e9cb529767cff5e7206e2e76531183085b42a @jplock 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 8c3e9cb

Please sign in to comment.