/Knowledge/sources/honojs__hono/llms-full/body-limit-middleware-usage-with-bun-for-large-requests--d84a57d46dc5.md
Body Limit Middleware: Usage with Bun for large requests - hono-docs
Body Limit Middleware: Usage with Bun for large requests Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.t...
Body Limit Middleware: Usage with Bun for large requests
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#usage-with-bun-for-large-requests
Summary
If the Body Limit Middleware is used explicitly to allow a request body larger than the default, it might be necessary to make changes to your Bun.serve configuration accordingly. [At the time of writing](https://github.com/oven-sh/bun...
Content
If the Body Limit Middleware is used explicitly to allow a request body larger than the default, it might be necessary to make changes to your Bun.serve configuration accordingly. At the time of writing, Bun.serve's default request body limit is 128MiB. If you set Hono's Body Limit Middleware to a value bigger than that, your requests will still fail and, additionally, the onError handler specified in the middleware will not be called. This is because Bun.serve() will set the status code to 413 and terminate the connection before passing the request to Hono.
If you want to accept requests larger than 128MiB with Hono and Bun, you need to set the limit for Bun as well:
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#usage-with-bun-for-large-requests",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Body Limit Middleware > Usage with Bun for large requests (1)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 267,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Body Limit Middleware: Usage with Bun for large requests",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}