webui: pretty urls by also appending .html

This commit is contained in:
Jörg Thalheim
2023-09-28 11:09:31 +02:00
parent 3f814c1e5f
commit cc70537a91

View File

@@ -20,8 +20,9 @@ async def root(path_name: str) -> Response:
return Response(status_code=403) return Response(status_code=403)
if not filename.is_file(): if not filename.is_file():
print(filename) if filename.suffix == "":
print(asset_path()) filename = filename.with_suffix(".html")
if not filename.is_file():
return Response(status_code=404) return Response(status_code=404)
content_type, _ = guess_type(filename) content_type, _ = guess_type(filename)