add name to wildcard route
This commit is contained in:
parent
888984694b
commit
d35646b5b1
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue