Skip to content

feat(source): accept raw body PUT/POST for application/json#294

Draft
shsteimer wants to merge 2 commits into
mainfrom
fix/raw-body-put-non-html
Draft

feat(source): accept raw body PUT/POST for application/json#294
shsteimer wants to merge 2 commits into
mainfrom
fix/raw-body-put-non-html

Conversation

@shsteimer

@shsteimer shsteimer commented Jun 17, 2026

Copy link
Copy Markdown

putHelper only passed raw-body requests to rawBodyPutHandler when Content-Type was text/html. Any other type (e.g. application/json) fell through to undefined and was silently dropped, causing non-HTML file uploads via raw PUT/POST to fail without an error. See adobe/helix-cli#2743.

The check is replaced with SUPPORTED_TYPES.includes(contentType) && !MEDIA_TYPES.includes(contentType), which covers both text/html and application/json using the existing constants. This supersedes adobe/helix-cli#2744, making that change unnecessary.

docs/openapi/source-api.yaml is also updated to document the PUT operation (accepted but previously undocumented) and to reflect that raw body is supported alongside multipart/form-data for both methods. Note: it's unclear how changes to that file get published to https://docs.da.live/developers/api/source — the site appears to be DA-authored content rather than generated from this repo.

Note for reviewers: DA auth > test get child rules is failing on main prior to this PR (Set.prototype.intersection not available in Node 20). Not introduced here and not addressed here — leaving it for a separate fix.

shsteimer and others added 2 commits June 17, 2026 11:03
Previously only text/html was handled by the raw body path in putHelper;
application/json (and any other non-form, non-media SUPPORTED_TYPE) fell
through to undefined and was silently dropped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shsteimer shsteimer changed the title fix(source): accept raw body PUT/POST for application/json feat(source): accept raw body PUT/POST for application/json Jun 17, 2026
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.

1 participant