-
-
Notifications
You must be signed in to change notification settings - Fork 243
Add lazy reading of response body #266
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
Conversation
Also check for opChain.failed in Body() method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR! Please see comments below.
d159043
to
7d9207b
Compare
Thanks for update! I'll review the code tomorrow, but here is one preliminary comment: we should wrap body into newBodyWrapper in response constructor, not in getContent. Because it's not guaranteed that getContent will be ever called. And adding newBodyWrapper is needed to ensure that if getContent is not called, the finalizer will close the body. (bodyWrapper has finalizer inside it). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments.
Sorry for the test case duplication. My code is ready for review again, @gavv |
Thanks for update! I've added a few small fixes:
|
Fixes #244