Skip to content

bun: Bun.serve does not capture request bodies #23884

Description

@isaacs

Deno calls captureBodyFromWinterCGRequest and Cloudflare calls captureIncomingRequestBody. Bun calls neither, so dataCollection.httpBodies and maxRequestBodySize have no effect on Bun.serve routes.

bunserver.ts:236 also builds normalizedRequest by hand rather than using winterCGRequestToRequestData, which is what Deno and Cloudflare use. Worth checking that header scrubbing matches.

Work item. Use winterCGRequestToRequestData and captureBodyFromWinterCGRequest in bunserver.ts.

**Prior art **(related history only). No issue for Bun. The Deno equivalent shipped as #22912 (merged, maxRequestBodySize for Deno HTTP bodies) and is the model to copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBunjavascriptPull requests that update javascript code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions