express
express copied to clipboard
bodyParsing and embedded arrays not parsing correctly
Ran into an issue with parsing arrays
<input type="text" name="parent[item[0][name]]">
<input type="text" name="parent[item[0][price]]">
The follow is parsed successfully, but each item object is saved as
{ 'name]': '4', 'price]': '5' } where the brace is added to the object
under
req.body.parent.item[0]
I understand there is a workaround where I can just collapse it down to
<input type="text" name="item[0][name]">
<input type="text" name="item[0][price]">
so it parses correctly as req.body.item[0].
this should be moved to https://github.com/visionmedia/node-querystring, that's the lib Connect uses, however I haven't seen that syntax in use before personally