Compare commits

...
2 Commits
Author SHA1 Message Date
retoor 284ef3d263 Added thumnails.
RUpload build / Build (push) Successful in 1m10s
2024-12-03 21:50:44 +01:00
retoor d388537fb5 Added thumnails. 2024-12-03 21:50:44 +01:00
+1 -4
View File
@@ -271,10 +271,7 @@ async def handle_upload(request: web.Request):
async def handle_thumbnail(request: web.Request): async def handle_thumbnail(request: web.Request):
path = request.match_info["path"] path = request.match_info["path"]
safe_path = pathlib.Path(request.app.upload_path).joinpath(path) safe_path = pathlib.Path(path)
if not safe_path.exists():
return web.Response(status=404, text="File not found.")
if not safe_path.is_file(): if not safe_path.is_file():
return web.Response(status=400, text="Invalid file type.") return web.Response(status=400, text="Invalid file type.")