-
Notifications
You must be signed in to change notification settings - Fork 1
Added support for multipart form data parsing #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.