Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
- fix bug when using permissions in Host
  • Loading branch information
devkral committed Jan 2, 2025
1 parent 4917912 commit 61e2ec0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lilya/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,7 @@ class Host(BasePath):
__slots__ = (
"host",
"app",
"__base_app__",
"name",
"middleware",
"permissions",
Expand All @@ -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
Expand Down Expand Up @@ -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]:
"""
Expand Down

0 comments on commit 61e2ec0

Please sign in to comment.