-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add always seekable body plugin #167
Conversation
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.
very cool! i have a comment on the testing, and a minor spelling nitpick on the phpdoc
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.
Good.
Do I want to decide if this should make only the response seekable?
hm, good question. it could make sense to distinguish that, because i assume adding the buffer is a significant cost that should be avoided when its unnecessary. rather than having flags, i would prefer to split the plugins into SeekableRequestBodyPlugin and SeekableResponseBodyPlugin (either way i think we can drop the "Always" from the name, it is more verbose without adding much more clarity imho) |
As you wish, we can also spli this into 2 plugins : RésponseBodySeekable and RequestBodySeekable, which may be better since you will not put this 2 plugins at the same place :
|
didn't even think of that, but yes, lets split the plugin then. |
Should be good, will update the documentation accordingly if this is good to merge |
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.
looks good to me!
What's in this PR?
Add a plugin that ensure request body or response body is always seekable
Why?
This may be needed when multiple librairies need to acces the content but are not aware of each other, so this allow them to read the body once and then rewind it.