Skip to content

hono/body-limit middleware fails to return response if file is too large. #327

@hanool

Description

@hanool

description

When using hono/body-limit middleware with @hono/node-server, large requests that exceed the body limit receive ERR_CONNECTION_RESET instead of error response.

environment

  • hono": "^4.12.8"
  • @hono/node-server": "^1.19.11"
  • node: 24.13.0

reproduce

  1. Create hono project with quick-start
  2. Add body-limit as usage example
  3. Post request to /upload with body size much larger than 50kb

or I have created reproduce repo

Note: This does not occur with small payloads slightly over the limit (e.g. 51KB). It reliably occurs with larger payloads (e.g. 1MB+). I believe this is because the client is still actively sending the request body when the server responds and closes the connection — smaller payloads finish transmitting before the socket is destroyed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions