nitro
nitro copied to clipboard
Connection reset when route returns before reading body if it is large enough
Environment
Nitro version: 0.4.12 Node version: 18.6.0 OS: Windows 10
Reproduction
The repo contains a simple server app with two routes:
- / (containing a simple HTML page with a button that sends a request for testing; the output will be logged to the JS console)
- /test (POST only, simply returning a string with body reading commented out)
Describe the bug
When returning a value from a route handler, if the incoming request has a body large enough (~4MB for me) and the handler hasn't read it, the server will abruptly close the connection resulting in a network error on the client side.
Additional context
I also tried similar setups with the Node http module and just h3 (also available in the linked repo), and both worked.
Logs
No response