A recent change seems to be filtering out null values from objects when encoding them. I use the request module for Node.js which depends on node-querystring and this change broke my application.
Calling stringify() on an object such as {var1: null, var2: null} returns an empty string when it should not.
The way the official Node.js 'querystring' module encodes it, and the way node-querystring has up until now is '?var1=&var2='. There has been a long discussion over at jQuery trying to determine how to encode null variables with $.param() and they also settled on '?var1=&var2='. For a long time jQuery has encoded it by setting '?var1=null&var2=null', but that behavior has changed in more recent versions. Either way, they do not throw away the variable.
A recent change seems to be filtering out
null
values from objects when encoding them. I use the request module for Node.js which depends on node-querystring and this change broke my application.Calling
stringify()
on an object such as{var1: null, var2: null}
returns an empty string when it should not.The way the official Node.js 'querystring' module encodes it, and the way node-querystring has up until now is '?var1=&var2='. There has been a long discussion over at jQuery trying to determine how to encode
null
variables with$.param()
and they also settled on '?var1=&var2='. For a long time jQuery has encoded it by setting '?var1=null&var2=null', but that behavior has changed in more recent versions. Either way, they do not throw away the variable.See jQuery discussion: http://bugs.jquery.com/ticket/8653