dev@locazia: try storage routing
This commit is contained in:
parent
ed88a38cd9
commit
01d56dae42
|
|
@ -98,9 +98,10 @@ async def s_api_v1_storage_get(request, file_hash=None):
|
||||||
if not content:
|
if not content:
|
||||||
return response.json({"error": "File not found"}, status=404)
|
return response.json({"error": "File not found"}, status=404)
|
||||||
|
|
||||||
make_log("Storage", f"File {content_sha256} requested by {request.ip}")
|
make_log("Storage", f"File {content_sha256} requested by {request.ctx.user}")
|
||||||
file_path = os.path.join(UPLOADS_DIR, content_sha256)
|
file_path = os.path.join(UPLOADS_DIR, content_sha256)
|
||||||
if not os.path.exists(file_path):
|
if not os.path.exists(file_path):
|
||||||
|
make_log("Storage", f"File {content_sha256} not found locally", level="error")
|
||||||
return response.json({"error": "File not found"}, status=404)
|
return response.json({"error": "File not found"}, status=404)
|
||||||
|
|
||||||
return await response.file(file_path)
|
return await response.file(file_path)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue