GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — querystring: use String.prototype.split's limit · lightsofapollo/node@27def4f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • querystring.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/querystring.js‎

Copy file name to clipboardExpand all lines: lib/querystring.js
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,20 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) {
209209
return obj;
210210
}
211211

212-
qs = qs.split(sep);
213-
214212
var maxKeys = 1000;
215213
if (options && typeof options.maxKeys === 'number') {
216214
maxKeys = options.maxKeys;
217215
}
218216

219-
var len = qs.length;
220217
// maxKeys <= 0 means that we should not limit keys count
221-
if (maxKeys > 0 && len > maxKeys) {
222-
len = maxKeys;
218+
if (maxKeys > 0) {
219+
qs = qs.split(sep, maxKeys);
220+
} else {
221+
qs = qs.split(sep);
223222
}
224223

224+
var len = qs.length;
225+
225226
var decode = QueryString.unescape;
226227
if (options && typeof options.decodeURIComponent === 'function') {
227228
decode = options.decodeURIComponent;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.