Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

BeBlood/symfony-routing-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony routing bug

Route for controller B has priority set:

    #[Route(path:  '/b', name: 'b_method', priority: 9999)]
    public function bMethodOne(): Response

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
 ---------------- -------- -------- ---------------- --------------------------

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages