mirror of https://github.com/lukechilds/node.git
Browse Source
Fix querystring.parse to handle multiple separator characters PR-URL: https://github.com/nodejs/node/pull/3807 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>process-exit-stdio-flushing
committed by
James M Snell
2 changed files with 26 additions and 1 deletions
@ -0,0 +1,24 @@ |
|||||
|
'use strict'; |
||||
|
const common = require('../common'); |
||||
|
const assert = require('assert'); |
||||
|
const qs = require('querystring'); |
||||
|
|
||||
|
assert.deepEqual( |
||||
|
qs.parse('foo=>bar&&bar=>baz', '&&', '=>'), |
||||
|
{foo: 'bar', bar: 'baz'} |
||||
|
); |
||||
|
|
||||
|
assert.strictEqual( |
||||
|
qs.stringify({foo: 'bar', bar: 'baz'}, '&&', '=>'), |
||||
|
'foo=>bar&&bar=>baz' |
||||
|
); |
||||
|
|
||||
|
assert.deepEqual( |
||||
|
qs.parse('foo==>bar, bar==>baz', ', ', '==>'), |
||||
|
{foo: 'bar', bar: 'baz'} |
||||
|
); |
||||
|
|
||||
|
assert.strictEqual( |
||||
|
qs.stringify({foo: 'bar', bar: 'baz'}, ', ', '==>'), |
||||
|
'foo==>bar, bar==>baz' |
||||
|
); |
Loading…
Reference in new issue