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: fix value decoding after encoded keys · nodejs/node@3f08131

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • querystring.js
  • test/parallel
    • test-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
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,9 @@ function parse(qs, sep, eq, options) {
555555
key += StringPrototypeSlice(qs, lastPos, i);
556556
key += plusChar;
557557
lastPos = i + 1;
558-
continue;
559558
}
559+
// Don't let key characters affect value encoding.
560+
continue;
560561
}
561562
if (code === 43/* + */) {
562563
if (lastPos < i)
Collapse file

‎test/parallel/test-querystring.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-querystring.js
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,18 @@ assert.strictEqual(qs.unescapeBuffer('a%%').toString(), 'a%%');
415415
// Test invalid encoded string
416416
check(qs.parse('%\u0100=%\u0101'), { '%Ā': '%ā' });
417417

418+
// Test encoded key with unencoded value
419+
{
420+
const input = '%C3%A4=caf\u00e9%';
421+
422+
check(
423+
qs.parse(input),
424+
{ '\u00e4': 'caf\u00e9%' });
425+
check(
426+
qs.parse(input, null, null),
427+
{ '\u00e4': 'caf\u00e9%' });
428+
}
429+
418430
// Test custom decode
419431
{
420432
function demoDecode(str) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.