Skip to content

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Jan 23, 2017

Fixes #7

* @returns {String} The decoded string.
* @api private
*/
function decode(input) {
Copy link

@pschultz pschultz Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to replace before decoding, otherwise percent-encoded plus signs get replaced too:

      var obj = qs.parse('foo+bar=baz%2Bqux');

      assume(obj).is.a('object');
      assume(obj['foo bar']).equals('baz+qux');

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, you are right, thanks.

@lpinca lpinca changed the title [fix] Convert plus signs to spaces Convert plus signs to spaces Feb 7, 2017
@lpinca lpinca mentioned this pull request Mar 20, 2017
@lpinca lpinca merged commit 0f3e729 into master Mar 20, 2017
@lpinca lpinca deleted the gh-7 branch March 20, 2017 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants