From 61e2ec0bc7d098189d5062e98f4de6a43b4fd6f4 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 2 Jan 2025 13:44:03 +0100 Subject: [PATCH] Changes - fix bug when using permissions in Host --- lilya/routing.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lilya/routing.py b/lilya/routing.py index 2a8c714..87bc8c3 100644 --- a/lilya/routing.py +++ b/lilya/routing.py @@ -986,6 +986,7 @@ class Host(BasePath): __slots__ = ( "host", "app", + "__base_app__", "name", "middleware", "permissions", @@ -1004,7 +1005,7 @@ def __init__( ) -> None: assert not host.startswith("/"), "Host must not start with '/'" self.host = host - self.app = app + self.app = self.__base_app__ = app self.name = name self.host_regex, self.host_format, self.param_convertors, self.path_start = compile_path( host @@ -1049,7 +1050,7 @@ def routes(self) -> list[BasePath]: """ Returns a list of declared path objects. """ - return getattr(self.app, "routes", []) + return getattr(self.__base_app__, "routes", []) def search(self, scope: Scope) -> tuple[Match, Scope]: """