-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
querystringIssues and PRs related to the built-in querystring module.Issues and PRs related to the built-in querystring module.
Description
The module querystring presents odd behaviour and inconsistent across platforms.
On NodeJs v14.2 x86_64 GNU/Linux
Parsing an object with an empty array into a querystring yields & with no element.
const querystring = require('querystring')
> querystring.stringify({ a:2, b:[] })
'a=2&' // expected result --> a=2 or a=2&b=
On Firefox 77.0.1 (64-bit)
Yet, when using the module in a react application with client side rendering the result is as follows:
import querystring from 'querystring'
> querystring.stringify({ a:2, b:[] }) // 'a=2'
This issue can lead to some of the following malformed URLs which may fault some server parsers. (My experience was with WSGI server)
Metadata
Metadata
Assignees
Labels
querystringIssues and PRs related to the built-in querystring module.Issues and PRs related to the built-in querystring module.