Closed mxr576 closed 6 years ago
might be a good idea to even add a test for this
Thanks for this PR.
Problem is that it will always be false, we use a decorator here but we should have implemented directly this interface as a FilteredStream cannot be seekable.
As an example, a deflate stream will build it's deflate "table" (how to decode this string) on the fly, which means reseeking at the begin of the stream will produce a different response if using the same table. (You need to reset the table also)
IMO, the correct way would be to override isSeekable
, seek
and rewind
functions to not allow those method (return false / throw exception), and an optional buffer option on top of plugin using the BufferedStream implementation.
We can close this if #100 is merged
"This method MUST attempt to seek to the beginning of the stream before reading data and read the stream until the end is reached."
https://github.com/php-fig/http-message/blob/master/src/StreamInterface.php#L28
What's in this PR?
This is a followup on this bug reported for the client-common package: https://github.com/php-http/client-common/issues/98