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)
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.
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:
This issue can lead to some of the following malformed URLs which may fault some server parsers. (My experience was with WSGI server)