Fix multipart/form-data requests missing content-type boundary#1
Merged
torbenlabs97 merged 1 commit intomainfrom Feb 10, 2026
Merged
Fix multipart/form-data requests missing content-type boundary#1torbenlabs97 merged 1 commit intomainfrom
torbenlabs97 merged 1 commit intomainfrom
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BuildContentFactorywas wrapping JSON bodies inStringContentwith media typemultipart/form-data, producingContent-Type: multipart/form-data; charset=utf-8— missing the requiredboundaryparameter500 InvalidDataException: Missing content-type boundaryon all ~28 multipart endpoints (documents, file uploads, etc.)MultipartFormDataContentwhen content type ismultipart/form-data, which auto-generates the correct boundaryTrace: https://signoz.awork.com/trace/e784880350752999508d2cecb294b04e?spanId=5bbfce6af151db4c
Test plan
dotnet buildsucceedsawork documents create --name "test" --is-private trueagainst production — returns200(previously500)Content-Typeheader now includes the boundary parameter🤖 Generated with Claude Code