Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix files offload #182

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ check-manifest = ">=0.25"
invenio-app-rdm = {version = "~=13.0.0b0.dev4", extras = ["opensearch2"]}
invenio-logging = {extras = ["sentry_sdk"], version = "~=2.0"}
cds-rdm = {editable=true, path="./site"}
# Re-enable when the pycountry dependency is updated
#cds-dojson = {git = "https://github.com/CERNDocumentServer/cds-dojson", ref = "rdm"}
#jsonschema = ">=4.17.0,<4.18.0" # due to compatibility issues with alpha
#invenio-rdm-migrator = "==1.0.0a14"
lxml = ">=4.6.5"
ipython = "!=8.1.0"
uwsgi = ">=2.0"
Expand Down
9 changes: 4 additions & 5 deletions site/cds_rdm/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ def send_file(
**kwargs,
):
"""Send file."""
offload_enabled = current_app.config["FILES_REST_XSENDFILE_ENABLED"]

# No need to proxy HEAD requests
offload_enabled = (
request.method != "HEAD"
and current_app.config["FILES_REST_XSENDFILE_ENABLED"]
)
should_offload = request.method != "HEAD" and offload_enabled

if not offload_enabled:
if not should_offload:
# don't offload if not enabled
return super().send_file(
filename,
Expand Down
Loading