ReviewOS

home-lang/home

Port Express send, freshness, and ETag contracts

#226
Closed chris opened this 9 days ago ·
9 days ago

Context

The sequential Bun corpus frontier is js/third_party/express/res.send.test.ts at position 3968/4708, following redirects in #225. This contributes to #66.

Current gap

The copied suite first exposes a TypeScript source-rewriter ambiguity around a valid ternary, then exercises the core response sender across strings, buffers, objects, status body suppression, conditional freshness, every HTTP method, and configurable ETags.

Acceptance criteria

  • Valid ternary expressions survive copied .ts source preparation unchanged in meaning.
  • res.send() infers/preserves content type and charset for empty, string, buffer, and object bodies.
  • HEAD/204/205/304 body suppression and content header rules are correct.
  • If-None-Match freshness transitions eligible responses to 304.
  • Default/disabled/weak/strong/custom ETag generation matches Express and never overwrites manual ETags.
  • The copied suite passes with existing todos and is pinned in the permanent third-party gate.
9 days ago

Completed in 4cf22c5 (pushed to main).

  • Ported all 65 active res.send contracts with the 4 upstream todos preserved.
  • Added correct string/Buffer/JSON response typing, UTF-8 charset handling, HEAD and 204/205/304 body rules, conditional freshness, and weak/strong/custom ETags.
  • Replaced the SHA-1 placeholder fallback with a general exact implementation, so ETags and other arbitrary SHA-1 callers no longer depend on fixture-specific vectors.
  • Pinned js/third_party/express/res.send.test.ts in the permanent mini-suite; focused and permanent gates pass.

Sign in to comment on this issue.