diff options
author | cloudhead <self@cloudhead.net> | 2010-08-05 03:13:40 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-08-05 10:46:28 -0700 |
commit | fe3e4196872b8ea6e49be1dec2e7fff72432abda (patch) | |
tree | 03315f83213d76e64ad4ed305632785093edd3bd /lib/querystring.js | |
parent | ffbbc465d3af25f207ea36a14a98014e9ca27b1a (diff) | |
download | nodejs-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.js | 1 |
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, |