Open ahopkins opened 1 year ago
No response
In v23.3 we will begin enforcing unique route names. We will need to force routes with multiple hosts to have a unique name with something like this:
diff --git a/sanic/router.py b/sanic/router.py index b68fde3b..b2e0fc69 100644 --- a/sanic/router.py +++ b/sanic/router.py @@ -139,6 +139,9 @@ class Router(BaseRouter): route.extra.static = static route.extra.error_format = error_format + if len(hosts) > 1 and host: + route.name = f"{route.name}__host_{host.replace('.', '_')}" + if error_format: check_error_format(route.extra.error_format)
Was this added in 23.3?
Is there an existing issue for this?
Is your feature request related to a problem? Please describe.
No response
Describe the solution you'd like
In v23.3 we will begin enforcing unique route names. We will need to force routes with multiple hosts to have a unique name with something like this:
Additional context
No response