Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix - do not remove OAuth param when using OAuth realm #1679

Merged
merged 2 commits into from Jul 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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