Skip to content

Commit a7ace72

Browse files
fao89bmbouter
authored andcommitted
Fix S3 URL
closes #2075
1 parent 18539ca commit a7ace72

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: CHANGES/2075.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed generation of the redirect url to the object storage

Diff for: pulpcore/content/handler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ async def _serve_content_artifact(self, content_artifact, headers, request):
790790
elif not settings.REDIRECT_TO_OBJECT_STORAGE:
791791
return ArtifactResponse(content_artifact.artifact, headers=headers)
792792
elif settings.DEFAULT_FILE_STORAGE == "storages.backends.s3boto3.S3Boto3Storage":
793-
content_disposition = f"attachment;filename={content_artifact.relative_path}"
793+
content_disposition = f"attachment%3Bfilename={content_artifact.relative_path}"
794794
parameters = {"ResponseContentDisposition": content_disposition}
795795
if headers.get("Content-Type"):
796796
parameters["ResponseContentType"] = headers.get("Content-Type")
@@ -802,7 +802,7 @@ async def _serve_content_artifact(self, content_artifact, headers, request):
802802
)
803803
raise HTTPFound(url)
804804
elif settings.DEFAULT_FILE_STORAGE == "storages.backends.azure_storage.AzureStorage":
805-
content_disposition = f"attachment;filename={artifact_name}"
805+
content_disposition = f"attachment%3Bfilename={artifact_name}"
806806
parameters = {"content_disposition": content_disposition}
807807
if headers.get("Content-Type"):
808808
parameters["content_type"] = headers.get("Content-Type")

0 commit comments

Comments
 (0)