[fix] Setter of request.query
does not save array when length of the array is 1
#1672
Labels
request.query
does not save array when length of the array is 1
#1672
Describe the bug
Node.js version: 16.10.0
OS version: Mac OS Monterey 12.3.1 (It doesn't matter...)
Description:
Actual behavior
Setter of
request.query
saves single element instead of the array.Setter of
request.query
usesqs.stringify
to save the input torequest.querystring
, and it would be converted into the form likekey=value1&key=value2
.But when array size is 1, it becomes unable to know whether it's array or string since it would be saved as
key=value1
.So preprocessing would be necessary I think.
Expected behavior
An array should be saved as I passed.
Code to reproduce
The text was updated successfully, but these errors were encountered: