Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Fix PathMiddlewareDecorator so that path changes in decorated middleware are respected #165

Merged
merged 5 commits into from
Apr 4, 2018
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Mar 30, 2018

This pull request provides a fix for zendframework/zend-expressive#606.

It fixes it for stratigility 3.0, but the same bug is present in stratigility 2.2. However, porting the changes should be easy.

@weierophinney weierophinney merged commit e6598cf into zendframework:master Apr 4, 2018
weierophinney added a commit that referenced this pull request Apr 4, 2018
Fix PathMiddlewareDecorator so that path changes in decorated middleware are respected
weierophinney added a commit that referenced this pull request Apr 4, 2018
weierophinney added a commit that referenced this pull request Apr 4, 2018
weierophinney added a commit that referenced this pull request Apr 4, 2018
@weierophinney
Copy link
Member

Thanks, @acelaya! I will push a patch for the v2.2 series shortly as well, based on this.

@acelaya
Copy link
Contributor Author

acelaya commented Apr 4, 2018

Perfect!

weierophinney added a commit to weierophinney/zend-stratigility that referenced this pull request Apr 4, 2018
Backports the test case from zendframework#165, and makes minor changes so it will
execute correctly under the v2.2 series. Test fails as expected.
weierophinney added a commit to weierophinney/zend-stratigility that referenced this pull request Apr 4, 2018
Updates the `PathRequestHandlerDecorator` to accept a string prefix
instead of a `ServerRequestInterface` to its constructor, and then to
use that to build the request path to pass to the handler. The
`PathMiddlewareDecorator` now passes the prefix instead of the original
request to the `PathRequestHandlerDecorator` constructor.

New test passes, but one existing test fails at this point.
weierophinney added a commit to weierophinney/zend-stratigility that referenced this pull request Apr 4, 2018
The test testMiddlewareCallingNextWithRequestPassesRequestToNextMiddleware
was using path segregated routes, but they were not pertinent to the
behavior being tested, and, in fact, broke once we fixed the behavior
reported in zendframework#165. The equivalent version 3 tests do not use path
segregated routes, so the path segregation was removed in order to
test the expected behavior correctly.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants