Skip to content

Commit

Permalink
File download resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus committed Nov 14, 2023
1 parent ac183c4 commit a97762c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions oarepo_ui/resources/file_resource.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from invenio_records_resources.resources import FileResource


class S3RedirectFileResource(FileResource):
"""
A workaround for the fact that the file resource with S3 backend does not
return HTTP 302 for pre-signed URLs.
"""
def read_content(self):
ret = super().read_content()
if ret[0].status_code == 302:
return ret[0], 302
else:
return ret
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-ui
version = 5.0.81
version = 5.0.82
description = UI module for invenio 3.5+
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down

0 comments on commit a97762c

Please sign in to comment.