Comments (7)
After some investigation.
/src/Adapter/Guzzle/GuzzleAdapter.php
the convertRequest(Request $request)
method casts the Symfony request into a string, and then passes this on to the MessageFactory class, this casting seems to lose everything in the request property in the Symfony request.
Once this is confirmed as a bug and not just me holding it wrong
which is entirely possible, I will make a PR over the next few days.
from php-proxy.
It looks like a bug, but I don't understand why it would lose the changes when casting to a string.
from php-proxy.
I did some tests, but for me it was working okay. I added an Authorization
header to the request and it was passed to Guzzle.
I did some small changes to the filter system. You can now also pass anonymous functions as filters.
Let me know if the last version also fixed your problem.
from php-proxy.
Yeah passing in headers was always fine, it was just when passing in more items onto the request.
$request->request->add(['bar' => 'baz']);
I can have a look later. I did also see some weirdness with applyRequestFilter and assigning that back, I see you have fixed that, thanks :)
Rich
from php-proxy.
Is the original issue fixed as well?
from php-proxy.
The original issue of trying to add items to the request (not the header, the actual request) still exists, I am a bit confused at the moment as to why a casting to a string loses information when it is listed perfectly fine pre-casting.
maybe I can put together some class to handle this conversion, either to string or directly to some JSON object, very strange one for sure.
/**
* Convert the Symfony request to a Guzzle request.
*
* @param Request $request
* @return RequestInterface
*/
protected function convertRequest(Request $request)
{
return $this->messageFactory->fromMessage((string) $request);
}
from php-proxy.
Further investigation, I think this is down to how the Symfony Request object is handling the casting via the toString() method in Request, this method in turn calls getContent() which then references php://input to get the contents once, not 100% sure yet, but I have a feeling this is where things are going a bit wonky, will keep playing around.
from php-proxy.
Related Issues (20)
- Class ServerRequestFactory not found HOT 5
- Problems with POST and forms HOT 4
- stress test exception!!
- Fatal error: Uncaught Error: Class 'Zend\Diactoros\Response\SapiEmitter' not found HOT 1
- Port gets lost on forwarded webpage.
- Zend\Diactoros\Response\SapiEmitter has been depricated HOT 4
- How can I send basic authentication with request? HOT 1
- HTTP ERROR 500 HOT 1
- Here's an alternative for Laravel 7, or PHP only:
- upload file proxy invalid HOT 2
- Need example how to change response body HOT 1
- Doesn't work with Laravel 8 HOT 3
- .
- EmitterException: Output has been emitted previously HOT 1
- Response of url to a varible
- POST form_params is not passed down/proxied at all
- Skip Ajax Requests
- Urls not redirected.
- How to forward to different Port?
- Failed opening required 'vendor/autoload.php'
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 php-proxy.