diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2012-01-16 16:13:43 +0600 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2012-01-16 16:36:24 +0600 |
commit | 23de33968f2b61a784b67308980e31a8d11bf094 (patch) | |
tree | 4ea24b4a7a95990b682803e8394f71d082951627 /lib/querystring.js | |
parent | f1678bfc65bcb2cda47bcb38f46b1723f0b26877 (diff) | |
download | android-node-v8-23de33968f2b61a784b67308980e31a8d11bf094.tar.gz android-node-v8-23de33968f2b61a784b67308980e31a8d11bf094.tar.bz2 android-node-v8-23de33968f2b61a784b67308980e31a8d11bf094.zip |
querystring: fix maxKeys = 0 is ignored
Diffstat (limited to 'lib/querystring.js')
-rw-r--r-- | lib/querystring.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/querystring.js b/lib/querystring.js index f2038f5b21..47e259a320 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -164,7 +164,12 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}, - maxKeys = options && options.maxKeys || 1000; + maxKeys = 1000; + + // Handle maxKeys = 0 case + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } if (typeof qs !== 'string' || qs.length === 0) { return obj; |