Browse Source

Bugfix in querystring

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
b9cd3363ef
  1. 2
      lib/querystring.js
  2. 4
      test/simple/test-querystring.js

2
lib/querystring.js

@ -68,7 +68,7 @@ QueryString.stringify = function (obj, sep, eq, name) {
}; };
QueryString.parseQuery = QueryString.parse = function (qs, sep, eq) { QueryString.parseQuery = QueryString.parse = function (qs, sep, eq) {
return qs return (qs || '')
.split(sep||"&") .split(sep||"&")
.map(pieceParser(eq||"=")) .map(pieceParser(eq||"="))
.reduce(mergeParams); .reduce(mergeParams);

4
test/simple/test-querystring.js

@ -114,6 +114,10 @@ var f = qs.stringify({
}); });
assert.equal(f, "a=b&q=x%3Dy%26y%3Dz"); assert.equal(f, "a=b&q=x%3Dy%26y%3Dz");
assert.doesNotThrow(function () {
qs.parse(undefined);
});
// nested in colon // nested in colon
var f = qs.stringify({ var f = qs.stringify({
a : "b", a : "b",

Loading…
Cancel
Save