Open herbertpimentel opened 2 years ago
This is expected, in the first case the query string is first parsed so you get
{ promo: '20%' }
which is then stringified to 'promo=20%25'
.
In the second case you are providing an already parsed query string which is only stringified.
> querystring.stringify({ promo: '20%25' })
'promo=20%2525'
to get the expected result you should use { promo: '20%' }
> querystring.stringify({ promo: '20%' })
'promo=20%25'
It results unexpected encoding, depending of the type of input used on set query
https://codepen.io/herbertpimentel/pen/vYeeVdz?editors=0011
Expected result: in both cases have the same output.