ReviewOS

home-lang/home

Port Undici Headers constructor validation corpus

#175
Closed chris opened this 10 days ago ·
10 days ago

Follow-up parity work discovered while completing the Bun.serve static response tranche in #66.

js/web/fetch/headers.undici.test.ts exposed missing Web-IDL constructor, iterator, validation, and header-list semantics in Home’s bootstrap runtime.

Completed scope:

  • reject primitive and malformed initializers with Bun-compatible TypeErrors
  • implement one-time iterator lookup and Web-IDL record/sequence conversion
  • normalize ByteString header values and preserve Set-Cookie lists
  • implement live sorted Headers iterators, method branding, arities, and inherited toString
  • retain user header casing on the wire while canonicalizing standard response names
  • preserve Request headers when fetch init overrides unrelated fields
  • enable the complete untouched upstream corpus without suppression

Tracked separately from #66 to keep the main parity log readable.

10 days ago

Completed and pushed in 1315342 (published on main via 2138c70).

Verification:

  • byte-identical upstream js/web/fetch/headers.undici.test.ts: 51 passed, 0 failed/TODO/unsupported
  • upstream SHA-256 in Home and ~/Code/bun: 63c995d683cbf2fd71281ef4d29c6c311009f02fd94ec218844147d43af65219
  • adjacent headers.test.ts: 94 passed
  • adjacent headers-case.test.ts: 3 passed
  • adjacent fetch_headers.test.js: 6 passed
  • adjacent Deno Headers corpus: 27 passed
  • adjacent Bun.serve Headers corpus: 1 passed
  • issue-21677 Date-header regression corpus: 2 passed
  • complete home_test: 1,134 total, 1 skipped, 0 failed
  • merged-tree gate rerun: exit 0
  • zig fmt --check and git diff --check: pass

The first broad gate caught canonical Date casing after user-case preservation; standard response canonicalization now takes precedence, and the corrected full gate passes.

Sign in to comment on this issue.