You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be nice to support pipes and other non-rewindable objects (another example would be Down::ChunkedIO), because HTTP.rb itself doesn't need the body to be rewindable. Is there any existing or potential features that would benefit from the constraint that the request body needs to be rewindable?
I think that Webmock, which is the one that motivated this change, could just replace the original request body object with the accumulated string, once it reads the original request body. For me that seems like the ideal solution.
I agree that we should not limit body to be rewindable. We just need to raise proper error if response body can't be rewinded upon re-usage attempt.
About WebMock in fact I agree that we should improve integration. I was thinking that I can "better" patch request in webmock... And in fact after some thinking - I guess we can/should extract webmock integration into a gem under httprb - so that adapter will be "in-sync" with http gem itself.
As of #468 pipes will cause failure:
That is because
reader
is an IO that supportsrewind
, but it's illegal on pipes:So, I think we should become more strict about what is allowed to be used as request body.
@httprb/core comments and thoughts are welcomed and appreciated!
The text was updated successfully, but these errors were encountered: