🚑 Fixed Storage download endpoint
This commit is contained in:
@@ -47,6 +47,9 @@ async def download_file(file_name: str):
|
|||||||
if file_name is None:
|
if file_name is None:
|
||||||
file_name = item.id.hex
|
file_name = item.id.hex
|
||||||
if storage.backend == "s3":
|
if storage.backend == "s3":
|
||||||
|
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))
|
return RedirectResponse(url=await storage.get_url(file_name, 300), headers=headers_from_storage_item(item))
|
||||||
try:
|
try:
|
||||||
download = await storage.download(file_name)
|
download = await storage.download(file_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user