bytespider / jsOAuth

JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
http://bytespider.github.com/jsOAuth/
MIT License
557 stars 109 forks source link

It's not possible to make GET requests with two query parameters having the same name #53

Open gauthierm opened 10 years ago

gauthierm commented 10 years ago

The QueryString class is an instance of Hash so at the data-structure level can only support one parameter with the same name. Both HTTP and OAuth place no restrictions on multiple query parameters with the same name. Some APIs require it as a feature.

Section 3.4.1.3.2 describes how multiple parameters of the same name must be handled. They should all be included in the base string and should be sorted by the byte order of their values.

Example use-case:

oauth.get(
    'http://www.myservice.com/api/method/?ids[]=1&ids[]=2',
    success,
    failure
);
bytespider commented 10 years ago

Ah yes, that seems possible. Bit of an oversight.

gauthierm commented 10 years ago

I can put together a PR but it won't be API compatible with the current version. Would that be accepted?

bytespider commented 10 years ago

Do what you can, i can always work your ideas in to an API compatable result.

— Sent from Mailbox for iPhone

On Fri, Oct 25, 2013 at 8:10 PM, Michael Gauthier notifications@github.com wrote:

I can put together a PR but it won't be API compatible with the current version. Would that be accepted?

Reply to this email directly or view it on GitHub: https://github.com/bytespider/jsOAuth/issues/53#issuecomment-27118066