Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed + as a space

  • Loading branch information...
commit 0b40ca5f0bf439a1bf3032eb172f8a0f828c84ba 1 parent 2b9796e
@tj authored
Showing with 4 additions and 1 deletion.
  1. +1 −1  lib/querystring.js
  2. +3 −0  test/querystring.test.js
View
2  lib/querystring.js
@@ -23,7 +23,7 @@ exports.parse = function(str) {
return String(str)
.split('&')
.reduce(function(ret, pair){
- var pair = decodeURIComponent(pair)
+ var pair = decodeURIComponent(pair).replace(/\+/g, ' ')
, eql = pair.indexOf('=')
, brace = lastBraceInKey(pair)
, key = pair.substr(0, brace || eql)
View
3  test/querystring.test.js
@@ -8,6 +8,9 @@ var qs = require('../')
module.exports = {
'test basics': function(){
+ qs.parse('foo=c++')
+ .should.eql({ foo: 'c ' });
+
qs.parse('a[>=]=23')
.should.eql({ a: { '>=': '23' }});
Please sign in to comment.
Something went wrong with that request. Please try again.