Closed mtrudel closed 2 months ago
This solution explicitly raises an HTTPError because returning an error tuple from Plug.Conn.Adapter.read_req_body/2
doesn't provide us with a way to track the failed read on the connection, so there's no way to meaningfully manage the connection once this happens. This puts a lot of onus on the user to properly ensure that nothing further gets done on the connection,
It also makes it really tricky to send a useful error to the client, and also to ensure that the connection is closed afterwards.
Moreover, it keeps the flow for this case the same as it is for all other HTTP error cases; the proper client signalling here just falls out of Bandit's design.
Fixes #384