303 if trailing slash is missing
This commit is contained in:
parent
6b301ab2e5
commit
594d57c89c
7
main.py
7
main.py
@ -20,6 +20,13 @@ def get_client(request: aiohttp.web.Request):
|
||||
return client
|
||||
|
||||
|
||||
@routes.get(CLIENT_REGEX)
|
||||
async def handler(request: aiohttp.web.Request):
|
||||
# this handler prevents people missing trailing slashes
|
||||
client = get_client(request)
|
||||
raise aiohttp.web.HTTPFound(f"/{client}/")
|
||||
|
||||
|
||||
@routes.get(CLIENT_REGEX + '/')
|
||||
async def handler(request: aiohttp.web.Request):
|
||||
client = get_client(request)
|
||||
|
Loading…
Reference in New Issue
Block a user