Repository navigation
Fix route resolution for PSR requests - #7
Merged
Merged
Conversation
Adapt PSR server requests for Symfony route matching and preserve matched route attributes on the forwarded request. Add regression coverage for wrapped and generic PSR requests. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The request adapter discards PSR-7 query parameters that differ from the URI, causing Symfony route conditions to see stale or missing values and potentially select the wrong route.
1 open issue
What changed in this PR
This PR bridges PSR server requests to the router’s Symfony-based matching API while forwarding matched route values to downstream handlers.
Changes:
- Adapts PSR requests for routing context and matching without reading the body.
- Forwards route values as PSR attributes while retaining Symfony attributes and framework setters.
- Adds regression tests for wrapped and generic PSR requests.
| File | Description |
|---|---|
tests/src/Middleware/RouteResolverMiddlewareTest.php |
Adds coverage for PSR matching, route attributes, routing context, and avoiding body access. |
src/Middleware/RouteResolverMiddleware.php |
Adds request adaptation and forwards requests containing matched route attributes. |
Review effort: Balanced
| [], | ||
| $request->getServerParams() | ||
| ); | ||
| $symfonyRequest->headers->replace($request->getHeaders()); |
Contributor
There was a problem hiding this comment.
Synced Symfony’s query bag from getQueryParams() for both adapted and reused requests, with regression coverage. Commit: cf794c4.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Validation