Skip to content

Commit

Permalink
Fix S3 URL
Browse files Browse the repository at this point in the history
closes pulp#2075
  • Loading branch information
fao89 committed May 9, 2022
1 parent 57e24ca commit 509ed3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/2075.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed generation of the redirect url to the object storage
4 changes: 2 additions & 2 deletions pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ async def _serve_content_artifact(self, content_artifact, headers, request):
elif not settings.REDIRECT_TO_OBJECT_STORAGE:
return ArtifactResponse(content_artifact.artifact, headers=headers)
elif settings.DEFAULT_FILE_STORAGE == "storages.backends.s3boto3.S3Boto3Storage":
content_disposition = f"attachment;filename={content_artifact.relative_path}"
content_disposition = f"attachment%3Bfilename={content_artifact.relative_path}"
parameters = {"ResponseContentDisposition": content_disposition}
if headers.get("Content-Type"):
parameters["ResponseContentType"] = headers.get("Content-Type")
Expand All @@ -802,7 +802,7 @@ async def _serve_content_artifact(self, content_artifact, headers, request):
)
raise HTTPFound(url)
elif settings.DEFAULT_FILE_STORAGE == "storages.backends.azure_storage.AzureStorage":
content_disposition = f"attachment;filename={artifact_name}"
content_disposition = f"attachment%3Bfilename={artifact_name}"
parameters = {"content_disposition": content_disposition}
if headers.get("Content-Type"):
parameters["content_type"] = headers.get("Content-Type")
Expand Down

0 comments on commit 509ed3b

Please sign in to comment.