Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Partial request body & Error when limit exceeded #356

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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

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

None yet

2 participants