Compare commits

...

2 Commits

Author SHA1 Message Date
284ef3d263 Added thumnails.
All checks were successful
RUpload build / Build (push) Successful in 1m10s
2024-12-03 21:50:44 +01:00
d388537fb5 Added thumnails. 2024-12-03 21:50:44 +01:00

View File

@ -271,10 +271,7 @@ async def handle_upload(request: web.Request):
async def handle_thumbnail(request: web.Request):
path = request.match_info["path"]
safe_path = pathlib.Path(request.app.upload_path).joinpath(path)
if not safe_path.exists():
return web.Response(status=404, text="File not found.")
safe_path = pathlib.Path(path)
if not safe_path.is_file():
return web.Response(status=400, text="Invalid file type.")