Comments (6)
from message.
Rewinding the stream is not hard, IF the stream is rewindable :)
If not the current design is broken as we have to replace the stream in the request passed to the formatter but since the request is immutable we cannot update the stream easily.
Then there is some work to do in the plugin calling the formatter which holds the responsability of rewinding / replacing the stream.
from message.
Also cloning / rewinding the stream is something that it's used in the cache plugin, maybe we can refactor this part to have an helper stream / class doing this ?
from message.
👍 For a helper class doing this. I did the same hack in an other PR: https://github.com/KnpLabs/php-github-api/pull/389/files#diff-192f7f95a475a8e6e67b97d1c5125367R22
Not too sure how to solve the broken design though... Maybe do not read the stream if it not is rewindable/seekable?
from message.
Or copy the stream.
from message.
We cant copy the string because the Request is immutable.
I've created a PR.
from message.
Related Issues (20)
- Tag new version HOT 1
- PSR-17 compatibility ? HOT 5
- DiactorosMessageFactory createResponse does not rewind strem if created with string body HOT 6
- Additional implementations of RequestMatcher HOT 1
- Package zendframework/zend-diactoros is abandoned HOT 3
- FullHttpMessageFormatter should be smarter about formatting binary request/response bodies HOT 3
- Release plans HOT 2
- Binary string detection is broken (introduced with 1.9.0) HOT 2
- Bug: Call to undefined function GuzzleHttp\\Psr7\\uri_for()
- GuzzleStreamFactory and guzzle/psr7:^2.0 HOT 1
- WSSE Authentication
- Expose request to resonse formatter HOT 6
- Compatibility issue since version 1.14.0 HOT 2
- Missing provides in composer.json file HOT 4
- False positive trigger of deprecation notice in FilteredStream HOT 10
- Reading GzipDecodeStream causes Uncaught RuntimeException: Unable to perform operation on closed stream HOT 5
- Unable to format binary payload as command HOT 5
- CurlFormatter fails on large boddies HOT 3
- MultipartStreamBuilder uses too much memory when building the stream with a big body HOT 4
- Oauth 2 authentication plugin HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from message.