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
  • Loading branch information
lubosmj committed Oct 8, 2024
1 parent f5c439c commit 723027a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES/5879.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Started propagating headers from the content-app in case 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 @@ -1002,12 +1002,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 723027a

Please sign in to comment.