Comments (3)
Okay, I've been able to create a small project that has the dependencies necessary to run the test, and verified the behavior.
For those who have clicked through to the gist, it's the second test that fails. Essentially, the first middleware executes, and then it descends into the nested pipeline, which executes correctly - but once complete, it does not return to the parent middleware.
This is quite odd, as this is almost exactly the sort of behavior that occurs when you run routed pipelines, which definitely work!
I need to investigate more here to determine if the issue is with how the MiddlewareFactory
is creating the nested pipeline, or if there's an issue within MiddlewarePipe
that needs to be resolved. I'll post more when I've had more time to investigate.
from zend-expressive.
I figured out the problem: https://github.com/zendframework/zend-expressive/blob/master/src/MiddlewareContainer.php#L66-L68
What happens here is that MiddlewarePipe
is also a RequestHandlerInterface
, which means that pipelines then get cast to RequestHandlerMiddleware
, which then calls handle()
on the pipeline, instead of process()
.
Locally, I changed that to:
if ($middleware instanceof RequestHandlerInterface
&& ! $middleware instanceof MiddlewareInterface
) {
$middleware = new RequestHandlerMiddleware($middleware);
}
This allows both of your tests to pass, which is good. Next step is to figure out a succinct way to reproduce the issue as a unit test, at which point I can write a patch.
from zend-expressive.
That's great! Thanks ever so much - That test I wrote is a country mile from succinct I'll agree
from zend-expressive.
Related Issues (20)
- Documentation for aggregating middlewares per host
- handler:create produces template in wrong location HOT 2
- 3.01 ConfigProvider class not imported HOT 1
- Modifications on the request's path are lost in expressive 2.2 and 3 when done in path-specific middlewares HOT 2
- Several selectable DI Containers do not implement Interop\Container, causing an error in Zend Expressive 3 HOT 2
- Problem with ApplicationConfigInjectionDelegator and Auryn HOT 2
- PHP-DI - Container -Suggestion HOT 4
- composer require zendframework/zend-expressive broken HOT 3
- It was debug difficult of an error occurred by after handle pipeline HOT 2
- ./vendor/bin/expressive Windows 10 HOT 1
- Empty response with WhoopsErrorResponseGenerator and zend-expressive-swoole HOT 1
- default_suffix HOT 3
- Subdirectories HOT 1
- NotFoundHandler generateTemplatedResponse Content Type missing HOT 2
- Path segregation - pipeline middleware - config-driven HOT 4
- Unable to handle errors in v1 HOT 3
- Typo in the docbloc HOT 5
- Zend Expressive vs Zend Framework 3 vs Zend Apigility for REST API with Swagger docs? HOT 3
- Angular 8 CORS error and Missing POST data
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 zend-expressive.