diff --git a/oarepo_ui/resources/file_resource.py b/oarepo_ui/resources/file_resource.py new file mode 100644 index 00000000..6dc0abd1 --- /dev/null +++ b/oarepo_ui/resources/file_resource.py @@ -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 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 90de75db..06d9c302 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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