Skip to content

Conversation

@pedep
Copy link
Contributor

@pedep pedep commented Sep 17, 2018

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

@pedep pedep force-pushed the feat/partial_request branch from 89d31b6 to 0b439be Compare September 17, 2018 15:27
@edgurgel
Copy link
Owner

I will play with this PR later this week. Thanks once again for the contribution!

@pedep
Copy link
Contributor Author

pedep commented Sep 28, 2018

Lets pause this and see what happens in benoitc/hackney#533

@edgurgel
Copy link
Owner

@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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants