bettiolo / oauth-signature-js

JavaScript OAuth 1.0a signature generator (RFC 5849) for node and the browser
https://www.npmjs.com/package/oauth-signature
BSD 3-Clause "New" or "Revised" License
232 stars 71 forks source link

Explicitly cast boolean and number values in signature base string #39

Closed okcoker closed 6 years ago

okcoker commented 6 years ago

So I just ran into #9 myself. I think @jmendiara has it a little mixed up in his example. Because of this line, if you were to generate a signature with parameters such as the following:

var params = {
     from: 0,
     another: false,
     to: 1
};

The signature base string would include something like: http://foo.com/bar?from=&another=&to=1 instead of http://foo.com/bar?from=0&another=false&to=1.

Without this, the user of the library would have to be mindful in always converting parameter values to strings. I also added tests so this fixes #9.

Any plans on upgrading uri-js for #34 #35 #38?

bettiolo commented 6 years ago

Makes sense, thanks for implementing the tests.

bettiolo commented 6 years ago

Release the updated npm package.

okcoker commented 6 years ago

Thanks for the quick turnaround!

bettiolo commented 6 years ago

Your PR was awesome, thanks for the effort and for updating the tests