You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the host in routes.yaml is commented out, the routing priority works as expected. The bin/console debug:router command outputs the following:
❯ bin/console debug:router
---------- -------- -------- ------ ------
Name Method Scheme Host Path
---------- -------- -------- ------ ------
b_method ANY ANY ANY /b
a_method ANY ANY ANY /a
---------- -------- -------- ------ ------
However, when the host is set, the routing priority seems to be lost. The bin/console debug:router command then shows a different order:
❯ bin/console debug:router
---------------- -------- -------- ---------------- --------------------------
Name Method Scheme Host Path
---------------- -------- -------- ---------------- --------------------------
a_method.fr ANY ANY www.domain.fr /a
a_method.en ANY ANY www.domain.com /a
b_method.fr ANY ANY www.domain.fr /b
b_method.en ANY ANY www.domain.com /b
---------------- -------- -------- ---------------- --------------------------
…uration (BeBlood)
This PR was merged into the 5.4 branch.
Discussion
----------
[Routing] Fix: lost priority when defining hosts in configuration
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | #58843
| License | MIT
When host are configured in routing, the original route is removed from the collection and then re-added. During this process, the route's priority is lost as it's not preserved during the removal and re-addition.
Bug has similarities with #52912 (resolved for prefix)
Commits
-------
437e6ad [Routing] Fix: lost priority when defining hosts in configuration
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
5.4
Description
Route for controller B has priority set:
When the host in
routes.yaml
is commented out, the routing priority works as expected. Thebin/console debug:router
command outputs the following:However, when the host is set, the routing priority seems to be lost. The
bin/console debug:router
command then shows a different order:How to reproduce
https://github.com/BeBlood/symfony-routing-bug
Possible Solution
#58842
Additional Context
The bug share similarities with #52912
The text was updated successfully, but these errors were encountered: