Requests hanging after previous request.body.read doesn't close
Quick Overview
Previous comment / where this is coming from: https://github.com/socketry/async-http/issues/183#issuecomment-3649099854
I'm experiencing an issue where the body read doesn't seem to close, causing the next request to hang. I suspect its due to a malformed request / bad headers / unusual client.
Async::HTTP::Serverrequest.body.readdoesn't seem to closerequest.body.closeafter request processing solves the issue- DragonRuby HTTP Client
Reproduce
I've created a minimal reproduce here with more example/data in the readme code https://github.com/dishcandanty/server-async-hang-reproduce
Overly simplifying:
- Send request
- Send second request (hangs on body read)
If the body.close is called, no issue. if the body.read is removed entirely, similarly no issues.
The "http client" where I'm reproducing the hang (haven't been able to reproduce with vanilla curl) is within DragonRuby, specifically using the http_post_body helpers
I haven't been able to reproduce this with vanilla curl even trying to replicate all the request data / headers. Ultimately though, I think its probably a bad thing that some malformed request can indefinitely hold open the server (malicious actors or silly devs doing weird things :D )