Added support for multipart form data parsing#52
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for encoding slices and arrays as repeated form fields in the multipart encoder, with special handling for []byte to treat it as a single scalar value rather than individual bytes.
Changes:
- Added logic in the
writeFieldmethod to detect slices and arrays and encode them as repeated form fields - Implemented special case handling for
[]byteto convert it to a string instead of individual byte values - Used recursive calls to handle nested structures and properly accumulate errors
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request updates the
Encoderlogic inpkg/multipart/multipart.goto improve how slices and arrays are handled when encoding form fields. The main change ensures that slices and arrays are written as repeated form fields, except for[]byte, which is treated as a single scalar value.Improvements to form field encoding:
writeFieldmethod to encode slices and arrays as repeated form fields, while handling[]byteas a single value instead of splitting it, ensuring correct multipart form serialization.