[PR #6936] [MERGED] fix(http): preserve legal response header names #7458

Closed
opened 2026-11-01 21:48:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6936
Author: @ShuaixinHuang
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @morluto

Base: main ← Head: codex/fix-http-response-header-identity


📝 Commits (4)

  • 600b393 fix(http): preserve legal response header names
  • 072a74e merge: synchronize upstream plist CI repair
  • abc6e47 chore: sync upstream plist validation and lifecycle fixes
  • 962292a chore: sync upstream native and launcher test contracts

📊 Changes

3 files changed (+44 additions, -22 deletions)

View changed files

📝 src/server/http/nodeHttpBridge.test.ts (+38 -16)
📝 src/server/http/nodeHttpBridge.ts (+1 -3)
📝 tests/acceptance/applications/mobileDirectoryComponents.test.ts (+5 -3)

📄 Description

Summary

Preserve legal response-header names when adapting a Web Response to node:http. A header named __proto__ is accepted by standard Headers but was silently dropped by assignment into an ordinary object.

Problem and expected behavior

The Web-to-Node response adapter must retain the supplied response headers. The old fields[name] = value path invokes the inherited setter for this legal field name, so an actual HTTP client never receives it. This is a newly reproduced boundary finding; no existing issue is linked.

Change and scope

Construct the header dictionary with Object.fromEntries at its existing owning boundary. Keep the existing separate Set-Cookie array and explicit Connection: close override. Two existing loopback-server scenarios cover both connection modes. No new endpoint or server capability.

Synchronization note: the normal pre-commit hook also simplifies one equivalent encrypted-ZIP fixture options expression in tests/acceptance/applications/mobileDirectoryComponents.test.ts; it does not add a product behavior change.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/server/http/nodeHttpBridge.ts, Web Headers to Node response headers before writeHead.
  • Contribution scope fit and linked maintainer decision: Ordinary correctness fix within existing boundaries; separate maintainer decision not applicable.
  • CLI and MCP/tool-catalog contract: Existing HTTP transport retains a legal response field that was previously omitted. CLI and MCP tool schemas/catalog are unchanged.
  • Provider, bridge, target-format, or platform compatibility: See scope and platform verification below; no new provider.
  • Evidence, artifact, provenance, or reconstruction contract: Payload, status, streaming behavior, cookies and body ownership remain with the existing response adapter.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): No new target or process authority. Uses the existing HTTP response path; tests bind only loopback ephemeral ports.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): None; no generated output, package or installation change.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/server/http/nodeHttpBridge.test.ts: both ordinary and forced-close loopback replies assert proto, constructor, a normal header, separate Set-Cookie values and the complete body. Existing HEAD, streaming and cancellation cases remain.
  • Base reproduction or other evidence: On base cc18e9ad, both new legal-header assertions fail: 2 failed, 8 passed. After the one-expression dictionary construction change, all 10 pass.
  • User-visible CLI/MCP output (if applicable): A fetch client of the actual loopback node:http server receives response.headers.get("proto") === "source-value". Cookie values remain separate and the forced-close branch still sends Connection: close.
  • Remaining proof gaps: Real local node:http transport on Windows, not a remote deployment, browser, TLS or native-provider run. No performance claim.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Synchronized with upstream b5c42dfc, including #6945, for six shared CI failures: two stale bound-target error expectations and four launcher/package fixture cases. The two source cases reproduce before synchronization (2 failed, 3 passed). After synchronization, all six previously failing cases pass; bound-target permissions and exact corrupted-catalog/CRLF/bytecode rejection assertions remain. Extended validation on the synchronized ZIP tree ran the complete metadata, MCP, TAR, plist and ZIP files: 231 passed, 22 existing platform skips, and one Windows-local catalog-recording timeout. An unchanged isolated rerun passed in 24 seconds; the original timeout remains recorded and does not establish whole-suite success. Real macOS plist CLI tests were skipped on Windows. The six plist boundary files still pass (64 passed, 3 existing platform skips). On this PR tree, all 10 real loopback HTTP tests passed; npm run check and npm run docs:check passed. Full new-head Linux CI must qualify the synchronized change.

Original fix baseline cc18e9ad; synchronized upstream b5c42dfc; current head 962292a745.

  • npm run test:local -- src/server/http/nodeHttpBridge.test.ts — all 10 tests passed on the independent final branch.
  • npm run check — all six tasks, module boundaries and architecture guards passed.
  • Formatting, git diff --check and normal commit/push hooks passed.
  • Local checks do not establish complete Linux CI success; consult the current-head Checks tab.

Compatibility, safety, and release

  • Breaking changes or migration steps: No migration. A previously omitted legal header is retained; existing multi-cookie and connection semantics are preserved.

  • Real Hopper/Ghidra, browser, or OS coverage: Pinned Node 24.22.1 on Windows x64; real loopback HTTP. No live external MCP client or provider qualification.

  • Package or release metadata impact: None.

  • Security, privacy, process, or containment review: No new target or process authority. Uses the existing HTTP response path; tests bind only loopback ephemeral ports.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6936 **Author:** [@ShuaixinHuang](https://github.com/ShuaixinHuang) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/fix-http-response-header-identity` --- ### 📝 Commits (4) - [`600b393`](https://github.com/morluto/rea/commit/600b3930f9f497d579f0eaf4a107cf76ca0d0d73) fix(http): preserve legal response header names - [`072a74e`](https://github.com/morluto/rea/commit/072a74e6bcf13f09e7c2b5a68a312b9978f93457) merge: synchronize upstream plist CI repair - [`abc6e47`](https://github.com/morluto/rea/commit/abc6e470ef7b59c93f4613e9855c40682440b0fa) chore: sync upstream plist validation and lifecycle fixes - [`962292a`](https://github.com/morluto/rea/commit/962292a7459da275d459f775d6b0f3ceb8b0df78) chore: sync upstream native and launcher test contracts ### 📊 Changes **3 files changed** (+44 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/server/http/nodeHttpBridge.test.ts` (+38 -16) 📝 `src/server/http/nodeHttpBridge.ts` (+1 -3) 📝 `tests/acceptance/applications/mobileDirectoryComponents.test.ts` (+5 -3) </details> ### 📄 Description ## Summary Preserve legal response-header names when adapting a Web Response to node:http. A header named `__proto__` is accepted by standard Headers but was silently dropped by assignment into an ordinary object. ## Problem and expected behavior The Web-to-Node response adapter must retain the supplied response headers. The old `fields[name] = value` path invokes the inherited setter for this legal field name, so an actual HTTP client never receives it. This is a newly reproduced boundary finding; no existing issue is linked. ## Change and scope Construct the header dictionary with Object.fromEntries at its existing owning boundary. Keep the existing separate Set-Cookie array and explicit Connection: close override. Two existing loopback-server scenarios cover both connection modes. No new endpoint or server capability. Synchronization note: the normal pre-commit hook also simplifies one equivalent encrypted-ZIP fixture options expression in `tests/acceptance/applications/mobileDirectoryComponents.test.ts`; it does not add a product behavior change. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/server/http/nodeHttpBridge.ts`, Web Headers to Node response headers before writeHead. - Contribution scope fit and linked maintainer decision: Ordinary correctness fix within existing boundaries; separate maintainer decision not applicable. - CLI and MCP/tool-catalog contract: Existing HTTP transport retains a legal response field that was previously omitted. CLI and MCP tool schemas/catalog are unchanged. - Provider, bridge, target-format, or platform compatibility: See scope and platform verification below; no new provider. - Evidence, artifact, provenance, or reconstruction contract: Payload, status, streaming behavior, cookies and body ownership remain with the existing response adapter. - Target selection, authority, upstream behavior, and cleanup details (if applicable): No new target or process authority. Uses the existing HTTP response path; tests bind only loopback ephemeral ports. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): None; no generated output, package or installation change. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [x] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/server/http/nodeHttpBridge.test.ts`: both ordinary and forced-close loopback replies assert __proto__, constructor, a normal header, separate Set-Cookie values and the complete body. Existing HEAD, streaming and cancellation cases remain. - Base reproduction or other evidence: On base cc18e9ad, both new legal-header assertions fail: 2 failed, 8 passed. After the one-expression dictionary construction change, all 10 pass. - User-visible CLI/MCP output (if applicable): A fetch client of the actual loopback node:http server receives response.headers.get("__proto__") === "source-value". Cookie values remain separate and the forced-close branch still sends Connection: close. - Remaining proof gaps: Real local node:http transport on Windows, not a remote deployment, browser, TLS or native-provider run. No performance claim. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed Synchronized with upstream `b5c42dfc`, including #6945, for six shared CI failures: two stale bound-target error expectations and four launcher/package fixture cases. The two source cases reproduce before synchronization (2 failed, 3 passed). After synchronization, all six previously failing cases pass; bound-target permissions and exact corrupted-catalog/CRLF/bytecode rejection assertions remain. Extended validation on the synchronized ZIP tree ran the complete metadata, MCP, TAR, plist and ZIP files: 231 passed, 22 existing platform skips, and one Windows-local catalog-recording timeout. An unchanged isolated rerun passed in 24 seconds; the original timeout remains recorded and does not establish whole-suite success. Real macOS plist CLI tests were skipped on Windows. The six plist boundary files still pass (64 passed, 3 existing platform skips). On this PR tree, all 10 real loopback HTTP tests passed; `npm run check` and `npm run docs:check` passed. Full new-head Linux CI must qualify the synchronized change. Original fix baseline cc18e9ad; synchronized upstream b5c42dfc; current head 962292a7459da275d459f775d6b0f3ceb8b0df78. - `npm run test:local -- src/server/http/nodeHttpBridge.test.ts` — all 10 tests passed on the independent final branch. - `npm run check` — all six tasks, module boundaries and architecture guards passed. - Formatting, git diff --check and normal commit/push hooks passed. - Local checks do not establish complete Linux CI success; consult the current-head Checks tab. ## Compatibility, safety, and release - Breaking changes or migration steps: No migration. A previously omitted legal header is retained; existing multi-cookie and connection semantics are preserved. - Real Hopper/Ghidra, browser, or OS coverage: Pinned Node 24.22.1 on Windows x64; real loopback HTTP. No live external MCP client or provider qualification. - Package or release metadata impact: None. - Security, privacy, process, or containment review: No new target or process authority. Uses the existing HTTP response path; tests bind only loopback ephemeral ports. ## Author readiness Human owner: @ShuaixinHuang - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:48:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7458
No description provided.