ReviewOS

home-lang/home

Port Express text body-parser contracts

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

Context

The sequential Bun corpus frontier is js/third_party/express/express.text.test.ts at position 3964/4708, following HTTP listen integration in #221 and the shared encoded-body groundwork in #220. This contributes to #66.

Acceptance criteria

  • express.text() parses text/plain bodies, zero-length input, and duplicate middleware safely.
  • Default/content-type charsets include UTF-8 and KOI8-R, with structured 415 errors before verify callbacks.
  • Length, numeric/string limits, identity/gzip/deflate decoding, and inflated-size errors reuse the shared byte pipeline.
  • Type functions/arrays and verify callbacks preserve status, type, raw body, message, and stack semantics.
  • The copied suite passes with existing todos and is pinned in the permanent third-party gate.
10 days ago

Completed on main in de9ddf9.

express.text() now shares the encoded byte pipeline while preserving text-specific semantics: text/plain defaults, zero-length and duplicate middleware handling, copied limits, type functions/arrays, verify errors, UTF-8 and KOI8-R decoding, gzip/deflate/identity support, inflated-size enforcement, and structured length/charset/encoding failures. JSON remains Unicode-only, so accepting KOI8-R for text does not regress the pinned JSON charset contract.

Verification: focused position 3964 reports files=1, passed=33, todo=7, failed=0, unsupported=0, allowed-empty=0; the focused JSON regression check and all permanent copied-corpus, SQL, and third-party gates pass.

Sign in to comment on this issue.