Skip to content

Commit

Permalink
Propagate response headers when using Azure, S3 or GCP storage
Browse files Browse the repository at this point in the history
closes #5879

(cherry picked from commit 7400434)
  • Loading branch information
lubosmj authored and ggainey committed Nov 11, 2024
1 parent 720d2eb commit 71ae0d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/5879.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started propagating headers from the content-app when using a non-default filesystem storage.
4 changes: 2 additions & 2 deletions pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,12 +1026,12 @@ def _build_url(**kwargs):
elif not domain.redirect_to_object_storage:
return ArtifactResponse(content_artifact.artifact, headers=headers)
elif domain.storage_class == "storages.backends.s3boto3.S3Boto3Storage":
raise HTTPFound(_build_url(http_method=request.method))
raise HTTPFound(_build_url(http_method=request.method), headers=headers)
elif domain.storage_class in (
"storages.backends.azure_storage.AzureStorage",
"storages.backends.gcloud.GoogleCloudStorage",
):
raise HTTPFound(_build_url())
raise HTTPFound(_build_url(), headers=headers)
else:
raise NotImplementedError()

Expand Down

0 comments on commit 71ae0d2

Please sign in to comment.