1. Start with a url like: http://somehost.com?foo=ONE&foo=TWO&foo=three #34

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@braitz

braitz commented Apr 7, 2011

Hi, I had problems getting the signature to work when I had multiple parameters with the same name. The following patch resolved my problem. Thanks!

  1. Start with a url like: http://somehost.com?foo=ONE&foo=TWO&foo=three&count=100

  2. oauth.js, _prepareParameters line 245 converts this to:

    {'foo[0]': 'ONE',
    'foo[1]': 'TWO',
    'foo[2]': 'THREE',
    count: '100' }

  3. oauth.js, _normaliseRequestParams line 137 needs to be fixed to NOT include the bracket notation in the string-to-sign:

argument_pairs[i][0]= this._encodeData( argument_pairs[i][0]);

changed to

argument_pairs[i][0]= this._encodeData( argument_pairs[i][0].match(/^[^[]*/)[0] );

Barbara Raitz
1. Start with a url like: http://somehost.com?foo=ONE&foo=TWO&foo=thr…
…ee&count=100

   
2. oauth.js, _prepareParameters line 245 converts this to:
   
   {'foo[0]': 'ONE', 
    'foo[1]': 'TWO', 
    'foo[2]': 'THREE', 
    count: '100' }

3.  oauth.js, _normaliseRequestParams line 137 needs to be fixed to NOT include the bracket notation in the string-to-sign:

  argument_pairs[i][0]= this._encodeData( argument_pairs[i][0]);

  changed to 

  argument_pairs[i][0]= this._encodeData( argument_pairs[i][0].match(/^[^[]*/)[0] );
@ciaranj

This comment has been minimized.

Show comment Hide comment
@ciaranj

ciaranj Apr 7, 2011

Owner

Hmm, I need to review my code, but perhaps it would be better if _prepareParameters omitted the indexing notation entirely (otherwise the sorting would be awry ? )

Owner

ciaranj commented Apr 7, 2011

Hmm, I need to review my code, but perhaps it would be better if _prepareParameters omitted the indexing notation entirely (otherwise the sorting would be awry ? )

@braitz

This comment has been minimized.

Show comment Hide comment
@braitz

braitz Apr 7, 2011

Perhaps. I'm not familiar with the code enough to know if that would impact something else. If it works, great! I know that the patch I submitted works for my requirements. Just thought I'd share. =)

Sent from my iPhone

On Apr 7, 2011, at 1:05 PM, ciaranjreply@reply.github.com wrote:

Hmm, I need to review my code, but perhaps it would be better if _prepareParameters ommitted the indexing notation entirely (otherwise the sorting would be awry ? )

Reply to this email directly or view it on GitHub:
#34 (comment)

braitz commented Apr 7, 2011

Perhaps. I'm not familiar with the code enough to know if that would impact something else. If it works, great! I know that the patch I submitted works for my requirements. Just thought I'd share. =)

Sent from my iPhone

On Apr 7, 2011, at 1:05 PM, ciaranjreply@reply.github.com wrote:

Hmm, I need to review my code, but perhaps it would be better if _prepareParameters ommitted the indexing notation entirely (otherwise the sorting would be awry ? )

Reply to this email directly or view it on GitHub:
#34 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment