fix(content): use multipart POST to upload files to DA#2744
Open
shsteimer wants to merge 2 commits into
Open
Conversation
The DA admin API only accepts raw body uploads for text/html. For all
other content types (including application/json), putHelper returns
undefined, causing putObject to write an empty {} to the props sidecar
instead of the file content. The server still returns 201 with a valid
JSON body, so helix-cli logged success and advanced the synced ref while
silently dropping the change.
Fix: replace the raw PUT with a multipart/form-data POST, wrapping the
buffer in a Blob in the `data` field. This is the documented DA API
contract for all file types. Rename putSource -> postSource to match.
Fixes: #2743
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a5a23f0 to
9a954aa
Compare
|
This PR will trigger a patch release when merged. |
- Adds missing push-level test: synced ref must not advance when postSource throws (mirrors the existing deleteFails scenario) - Corrects opts.onUpload JSDoc to document all three callback args Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tripodsan
requested changes
Jun 14, 2026
tripodsan
left a comment
Contributor
There was a problem hiding this comment.
I'd rather change the server to finally allow non multipart puts....
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.
Related Issues
Fixes #2743.
DaClient.postSource(previouslyputSource) now sends files asmultipart/form-data POSTwith the content as aBlobin thedatafield, matching the documented DA API contract. The previous raw-bodyPUTwithContent-Type: application/jsonwas silently ignored by the server for all non-HTML files.The rename from
putSource→postSourceis internal —DaClientis not exported from the package.Note: potentially related to #2709, which adds JSON to the default clone set.
Thanks for contributing!