diff --git a/app/routes.py b/app/routes.py index 6c3c969..971647b 100644 --- a/app/routes.py +++ b/app/routes.py @@ -77,7 +77,9 @@ async def setup_routes(app, handler): for chat_id in include_chats: chat = await client.get_entity(chat_id) alias_id = h.generate_alias_id(chat) - routes.extend(get_common_routes(alias_id)) # returns list() of common routes + routes.extend( + get_common_routes(alias_id) + ) # returns list() of common routes log.debug(f"Index added for {chat.id} at /{alias_id}") - routes.append(web.view(r"/{wildcard:.*}", h.wildcard)) + routes.append(web.view(r"/{wildcard:.*}", h.wildcard, name="wildcard")) app.add_routes(routes) diff --git a/app/views/middlewhere.py b/app/views/middlewhere.py index 96afc0e..1464d62 100644 --- a/app/views/middlewhere.py +++ b/app/views/middlewhere.py @@ -12,10 +12,7 @@ log = logging.getLogger(__name__) def _do_basic_auth_check(request): auth_header = request.headers.get(hdrs.AUTHORIZATION) if not auth_header: - if ( - request.match_info is not None - and "download_" in request.match_info.route.name - ): + if "download_" in request.match_info.route.name: return Response( body=b"", status=401,