tusd: Set metadata correctly in S3.

The Content-Type, Content-Disposition, StorageClass, and general
metadata are not set according to our patterns by tusd; copy the file
to itself to update those properties.
This commit is contained in:
Alex Vandiver
2024-09-25 19:39:49 +00:00
committed by Tim Abbott
parent 287850d08d
commit 638c579c56
4 changed files with 124 additions and 13 deletions

View File

@@ -87,6 +87,10 @@ def upload_content_to_s3(
extra_metadata: dict[str, str] | None = None,
filename: str | None = None,
) -> None:
# Note that these steps are also replicated in
# handle_upload_pre_finish_hook in zerver.views.tus, to update
# properties for files uploaded via TUS.
key = bucket.Object(path)
metadata: dict[str, str] = {}
if user_profile: