Feature: Partial request body & Error when limit exceeded
From #355 - Continued
I'm sorry, but it seems #354's assumed behaviour was wrong.
I assumed the :max_length in body/2 would error, because, what would an incomplete response be worth, but it seems it simply returns the body up until :max_length.
I have corrected the doc and spec to reflect this.
I will submit another PR implementing this behaviour in HTTPoison, since my original intention was to protect against too much data being returned with an error.
Sorry for the mistake @edgurgel
This PR allows for both partial body reading and error on exceeded limit.
The parse_request_body function is mostly based on the :hackney_response.read_body/3 function
I will leave #355 open, since it should be merged regardless, while this could be subject to change, pending CR
I will play with this PR later this week. Thanks once again for the contribution!
Lets pause this and see what happens in https://github.com/benoitc/hackney/issues/533
@pedep okay! Thank you for pushing this forward to hackney as it seems a more natural place for the feature. Let's see how it goes 👍