Uh oh!
There was an error while loading. Please reload this page.
feat(http): add RespondBytes for raw binary response payloads - #133
Conversation
Closes the gap between RespondText and RespondJson - a consumer needing to serve raw bytes (e.g. a fetched certificate's DER bytes) previously had to round-trip through a Latin1-encoded string, an awkward workaround surfaced by dogfood evidence in alexa-vox-craft. Follows RespondJson's serialize-once-to-bytes model; recorded as ADR-0051 Amendment 2. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMQEjFrUVGYkctE3ECfRuA
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:f035438b42
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ge guide Address Codex review feedback on PR #133: RespondBytes retained the caller's byte[] by reference instead of copying it, so a post-registration mutation or buffer reuse would silently change an already-registered response - breaking the serialize-once snapshot semantics RespondJson already provides and this method's own doc claimed to match. Also add RespondBytes to docs/packages/compono-http.md's Response APIs list, which was updated everywhere except the consumer-facing package guide. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMQEjFrUVGYkctE3ECfRuA
ncipollina
commented
Sep 4, 2026
…edback The task file's Phase 3 covered replying to and resolving feedback but never mentioned requesting a fresh bot review scoped to the fix commit once real code changes are pushed - an established pattern this session used, now made explicit so it isn't re-derived ad hoc next time. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMQEjFrUVGYkctE3ECfRuA
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:4bc5838f5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…erence The published compono skill's http.md enumerated every Respond* finalizer for consumers writing Compono.Http tests, but was written before RespondBytes existed (PR #133). Add it alongside the others so skill guidance doesn't quietly fall behind the package's actual API surface. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMQEjFrUVGYkctE3ECfRuA
Address Codex review feedback on PR #133: PLAN-0051's Response APIs (Task 4) and Behavioral tests (Task 9) checklists still only enumerated the pre-Amendment-2 Respond* set, so the plan no longer accurately reflected Compono.Http's completed public behavior and test coverage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GMQEjFrUVGYkctE3ECfRuA
Uh oh!
There was an error while loading. Please reload this page.
Summary
Adds
HttpResponseRegistrationBuilder.RespondBytes(byte[], mediaType)toCompono.Http, closing a gap betweenRespondTextandRespondJson: no way to serve a raw binary payload. Surfaced by dogfood evidence inalexa-vox-craft, where a test needing to serve a fetched certificate's DER bytes had to round-trip them throughEncoding.Latin1text as a workaround.Changes
src/Compono.Http/HttpResponseRegistrationBuilder.cs- newRespondBytes(byte[] content, string mediaType = "application/octet-stream"), followingRespondJson's serialize-once-to-bytes model (content captured once, a freshByteArrayContent+MediaTypeHeaderValueper matched invocation).docs/adr/0051-compono-http-handler-based-testing-package.md- recorded as Amendment 2 (purely additive, source-compatible extension, not a reversal of the original decision).test/Compono.Http.Tests/TestHttpHandlerTests.cs- two new tests: byte round-trip with default content type, and custom media type.docs/reference/api/Compono.Http/- regenerated via.github/scripts/generate-api-reference.sh.Validation
dotnet test test/Compono.Http.Tests/Compono.Http.Tests.csproj -f net10.0- 31/31 passed