🚑 Fixed Storage download endpoint

This commit is contained in:
Mawoka
2023-06-12 20:46:40 +02:00
parent 4e55f21138
commit 9cbb502cf3
+4 -1
View File
@@ -47,7 +47,10 @@ async def download_file(file_name: str):
if file_name is None:
file_name = item.id.hex
if storage.backend == "s3":
return RedirectResponse(url=await storage.get_url(file_name, 300), headers=headers_from_storage_item(item))
if item is None:
return RedirectResponse(url=await storage.get_url(file_name, 300))
else:
return RedirectResponse(url=await storage.get_url(file_name, 300), headers=headers_from_storage_item(item))
try:
download = await storage.download(file_name)
except DownloadingFailedError: