Skip to content

Commit

Permalink
Bugfix in querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 6, 2010
1 parent 5c78c45 commit b9cd336
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ QueryString.stringify = function (obj, sep, eq, name) {
};

QueryString.parseQuery = QueryString.parse = function (qs, sep, eq) {
return qs
return (qs || '')
.split(sep||"&")
.map(pieceParser(eq||"="))
.reduce(mergeParams);
Expand Down
4 changes: 4 additions & 0 deletions test/simple/test-querystring.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ var f = qs.stringify({
});
assert.equal(f, "a=b&q=x%3Dy%26y%3Dz");

assert.doesNotThrow(function () {
qs.parse(undefined);
});

// nested in colon
var f = qs.stringify({
a : "b",
Expand Down

0 comments on commit b9cd336

Please sign in to comment.