Skip to content

Conversation

@djthorpe
Copy link
Member

This pull request updates the Encoder logic in pkg/multipart/multipart.go to 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:

  • Updated the writeField method to encode slices and arrays as repeated form fields, while handling []byte as a single value instead of splitting it, ensuring correct multipart form serialization.

@djthorpe djthorpe self-assigned this Jan 17, 2026
Copilot AI review requested due to automatic review settings January 17, 2026 09:40
Copy link
Contributor

Copilot AI left a 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 writeField method to detect slices and arrays and encode them as repeated form fields
  • Implemented special case handling for []byte to 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.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

@djthorpe djthorpe merged commit f890f64 into main Jan 17, 2026
10 checks passed
@djthorpe djthorpe deleted the djt/0117/multipart branch January 17, 2026 10:10
@djthorpe djthorpe restored the djt/0117/multipart branch January 17, 2026 15:05
@djthorpe djthorpe deleted the djt/0117/multipart branch January 26, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants