protocol-http
protocol-http copied to clipboard
Introduce `rewind` and `rewindable?` as a general concept.
There are situations where we need to rewind the input or output, for example idempotent request handling and redirects. Previously, body.respond_to?(:rewind) was used but it's better to expose a predicate.
In addition, I noticed that we have two usage of wrap(body) and wrap(request|response). I'd like to use a different method name if possible, and this also applies to rewindable body wrappers.
Types of Changes
- New feature.
- Maintenance.
Contribution
- [x] I added tests for my changes.
- [x] I tested my changes locally.
- [x] I agree to the Developer's Certificate of Origin 1.1.