Skip to content

Fix multipart/form-data requests missing content-type boundary#1

Merged
torbenlabs97 merged 1 commit intomainfrom
fix/multipart-form-data-boundary
Feb 10, 2026
Merged

Fix multipart/form-data requests missing content-type boundary#1
torbenlabs97 merged 1 commit intomainfrom
fix/multipart-form-data-boundary

Conversation

@torbenlabs97
Copy link
Contributor

Summary

  • BuildContentFactory was wrapping JSON bodies in StringContent with media type multipart/form-data, producing Content-Type: multipart/form-data; charset=utf-8 — missing the required boundary parameter
  • This caused a 500 InvalidDataException: Missing content-type boundary on all ~28 multipart endpoints (documents, file uploads, etc.)
  • Convert the JSON body into a proper MultipartFormDataContent when content type is multipart/form-data, which auto-generates the correct boundary

Trace: https://signoz.awork.com/trace/e784880350752999508d2cecb294b04e?spanId=5bbfce6af151db4c

Test plan

  • dotnet build succeeds
  • All 58 tests pass
  • Tested awork documents create --name "test" --is-private true against production — returns 200 (previously 500)
  • Verified via SignOz that the Content-Type header now includes the boundary parameter

🤖 Generated with Claude Code

BuildContentFactory was wrapping the JSON body in StringContent with
media type "multipart/form-data", producing a Content-Type header like
"multipart/form-data; charset=utf-8" — missing the required boundary
parameter. This caused a 500 InvalidDataException on every multipart
endpoint (~28 endpoints including documents and file uploads).

Convert the JSON body into a proper MultipartFormDataContent when the
content type is multipart/form-data, which auto-generates the correct
boundary.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Contributor

@nilzzzzzz nilzzzzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@torbenlabs97 torbenlabs97 merged commit ff9f6a5 into main Feb 10, 2026
1 check passed
@hendrikmitk hendrikmitk deleted the fix/multipart-form-data-boundary branch March 4, 2026 13:35
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