Skip to content
Myr

fix(middleware/body-limit): set default duplex option for readable stream (#2837)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* fix(middleware/body-limit): set default duplex option for readable stream * test: should return 200 response without user-defined duplex option * fix: revert and avoid ts-expect-error

authored by fzn0x · committed by GitHub · parent 116867a · Browse files · 2 files+4 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−13 removed

  • tests:+2 added−12 removed
  • other:+2 added−1 removed

2 files+4 added−13 removed

modified:src/middleware/body-limit/index.test.ts+2 added-12 removed
modified:src/middleware/body-limit/index.ts+2 added-1 removed
101 unmodified lines
102 }103 },104 })105106 const requestInit: RequestInit & { duplex: 'half' } = { body: reader, duplex: 'half' }106 c.req.raw = new Request(c.req.raw, { body: reader })107 c.req.raw = new Request(c.req.raw, requestInit as RequestInit)108109 await next()110111 if (c.error instanceof BodyLimitError) {
4 unmodified lines