summaryrefslogtreecommitdiff
path: root/lib/querystring.js
diff options
context:
space:
mode:
authorcloudhead <self@cloudhead.net>2010-08-05 03:13:40 -0400
committerRyan Dahl <ry@tinyclouds.org>2010-08-05 10:46:28 -0700
commitfe3e4196872b8ea6e49be1dec2e7fff72432abda (patch)
tree03315f83213d76e64ad4ed305632785093edd3bd /lib/querystring.js
parentffbbc465d3af25f207ea36a14a98014e9ca27b1a (diff)
downloadnodejs-fe3e4196872b8ea6e49be1dec2e7fff72432abda.tar.gz
nodejs-fe3e4196872b8ea6e49be1dec2e7fff72432abda.tar.bz2
nodejs-fe3e4196872b8ea6e49be1dec2e7fff72432abda.zip
querystring.parse: handle undefined value properly
Diffstat (limited to 'lib/querystring.js')
-rw-r--r--lib/querystring.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/querystring.js b/lib/querystring.js
index ba2b1cc9d..69ea00854 100644
--- a/lib/querystring.js
+++ b/lib/querystring.js
@@ -77,6 +77,7 @@ var chunks = /(?:(?:^|\.)([^\[\(\.]+)(?=\[|\.|$|\()|\[([^"'][^\]]*?)\]|\["([^\]"
// Parse a key=val string.
QueryString.parse = QueryString.decode = function (qs, sep, eq) {
var obj = {};
+ if (qs === undefined) { return {} }
String(qs).split(sep || "&").map(function (keyValue) {
var res = obj,
next,