Skip to content

Commit

Permalink
Merge pull request #1679 from abacuslabs/master
Browse files Browse the repository at this point in the history
Fix - do not remove OAuth param when using OAuth realm
  • Loading branch information
simov committed Jul 17, 2015
2 parents bb57809 + 23cb186 commit 50ee190
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/oauth.js
Expand Up @@ -81,7 +81,7 @@ OAuth.prototype.concatParams = function (oa, sep, wrap) {
}).sort()

if (oa.realm) {
params.splice(0, 1, 'realm')
params.splice(0, 0, 'realm')
}
params.push('oauth_signature')

Expand Down
3 changes: 3 additions & 0 deletions tests/test-oauth.js
Expand Up @@ -427,6 +427,7 @@ tape('query transport_method + form option + url params', function(t) {
'c@': '',
a2: 'r b',
realm: 'Example',
oauth_consumer_key: '9djdj82h48djs9d2',
oauth_nonce: '7d8f3e4a',
oauth_signature_method: 'HMAC-SHA1',
oauth_timestamp: '137131201',
Expand Down Expand Up @@ -472,6 +473,7 @@ tape('query transport_method + qs option + url params', function(t) {
'c@': '',
c2: '',
realm: 'Example',
oauth_consumer_key: '9djdj82h48djs9d2',
oauth_nonce: '7d8f3e4a',
oauth_signature_method: 'HMAC-SHA1',
oauth_timestamp: '137131201',
Expand Down Expand Up @@ -543,6 +545,7 @@ tape('body transport_method + form option + url params', function(t) {
{ c2: '',
a3: '2 q',
realm: 'Example',
oauth_consumer_key: '9djdj82h48djs9d2',
oauth_nonce: '7d8f3e4a',
oauth_signature_method: 'HMAC-SHA1',
oauth_timestamp: '137131201',
Expand Down

0 comments on commit 50ee190

Please sign in to comment.