-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
678: Cast body to a string to force rewind of stream r=brunoocasali a=grizzm0 # Pull Request ## What does this PR do? - Rewinds the PSR-7 StreamInterface When reading a PSR-7 StreamInterface with getContents() the stream is not automatically rewound. If you for example attach a middleware in Guzzle that reads the StreamInterface but does not rewind it afterwards any calls afterwards will read from the end of the stream resulting in an empty string. However, then casting the StreamInterface to a string using __toString() then the stream MUST attempt to seek to the beginning of the stream. See https://www.php-fig.org/psr/psr-7/#34-psrhttpmessagestreaminterface Co-authored-by: Kristofer Karlsson <karlsson.kristofer@gmail.com>
- Loading branch information
Showing
3 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters