In multipart/form-data request content, Should Content-Disposition attribute come after boundary immediately?
Most of the nodejs multipart parsers (parse-multipart-data, multipart-form-parser) expects Content-Disposition (having name attribute) after boundary specification immediately.
If multipart/form-data request content received as below (Content-Disposition is not next to boundary), then it fails to parse.
--1da5f447-20f9-47d3-b8a0-5f83304948e8
Content-Type: application/json
Content-Length: 268
Content-Disposition: form-data; name="file1"
....
--1da5f447-20f9-47d3-b8a0-5f83304948e8
Content-Type: application/octet-stream
Content-Length: 172364
Content-Disposition: form-data; name="file2"; filename="20220317112742168.zip"
...
--1da5f447-20f9-47d3-b8a0-5f83304948e8--
But all browser (chrome, Firefox) HTML form submit, and Postman request submit having Content-Disposition next after boundary as below
--1da5f447-20f9-47d3-b8a0-5f83304948e8
Content-Disposition: form-data; name="file1"
Content-Type: application/json
Content-Length: 268
....
--1da5f447-20f9-47d3-b8a0-5f83304948e8
Content-Disposition: form-data; name="file2"; filename="20220317112742168.zip"
Content-Type: application/octet-stream
Content-Length: 172364
...
--1da5f447-20f9-47d3-b8a0-5f83304948e8--