ReviewOS

home-lang/home

Port Express sendFile contracts

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

Continue Bun corpus parity at position 3969 by porting js/third_party/express/res.sendFile.test.ts without modifying the copied corpus.

Acceptance criteria:

  • Validate missing, non-string, non-absolute, and root-bounded paths with useful Express-compatible errors and stacks.
  • Transfer native corpus fixtures with content types, callback completion/error behavior, HEAD support, ranges, and correct 404/403 handling.
  • Implement cache-control, immutable/max-age, dotfile, custom-header, last-modified, and conditional freshness options.
  • Preserve upstream todos and pin the copied file in the permanent third-party mini-suite with zero failures or unsupported cases.
  • Push the completed conventional commit to main as Chris Breuer without coauthors and update #66.
10 days ago

Completed in 5a96c21 (pushed to main).

  • Ported all 39 active res.sendFile contracts with 11 upstream todos preserved.
  • Added strict path validation/root containment, byte-accurate native fixture reads, callback success/error behavior, HEAD and range responses, dotfile policies, custom headers, cache-control/immutable/max-age, last-modified freshness, and MIME inference.
  • File errors retain their native cause and add both the requested path and an explicit res.sendFile stack frame.
  • Pinned js/third_party/express/res.sendFile.test.ts in the permanent mini-suite; focused and permanent gates pass.

Sign in to comment on this issue.