-
-
Notifications
You must be signed in to change notification settings - Fork 143
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 Browser middleware #492
Conversation
There seems to be a segmentation fault in the PHP8.1 build. I also don't know what the error in the PHP5.3 builds wants to tell me.
The signature is the same as in the interface. |
Done this some years ago over at https://github.com/orgs/php-api-clients/repositories?q=middleware-&type=all&language=&sort= and would love to see this land directly in here instead of building on top of it. Things like gzip and other compressions could also benefit from this. Other things that come to mind are metrics about requests per route/method/whatever, tracing, or authentication. Maybe even #445 could benefit from this before it lands directly in this package. This, IMHO would be a great feature candidate for our next major: v3. |
Hi @WyriHaximus, |
Well, I'm not the only one to convince, talked about this with @clue and @SimonFrings in the past and we had other features to include back then.
We went with v3 instead of v2 for aesthetic reasons and to keep it in line with other packages already having a v2. With v3 we're pulling everything on the same minimum version again. |
@R4c00n Thanks for opening this PR, this is definitely a cool feature and something I want to see being part of this component! 👍
It seems like it has some problem with the
As @WyriHaximus said, we decided to go for v3 instead of v2 to keep our versioning consistent across all our projects (especially because of promise v3), you can read all about our decision here: https://github.com/orgs/reactphp/discussions/472#discussioncomment-3680968 Also a little heads up, once all tests are green and this is ready to merge, make sure to combine your commits into one. Nothing to worry about now, I think it makes most sense to do this, once everything is in and functional ;) |
It seems like this ticket is open for quite a while now and haven't received any updates since. To avoid issues and pull request laying around for too long, I'll close this for now. We're currently working towards a |
Inspired by Guzzle middlewares I added a middleware system to the Browser component.
I took the already existing \React\Http\Io\MiddlewareRunner as an example for this.
Example usage:
My concrete use case right now is that I want to keep track of the last request for advanced logging. I do this by storing request information in a custom middleware.
Please let me know what you think and if I should apply some changes to my code in order for this to get merged :)