mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 21:45:25 +08:00
Backport of #37710 to release/2026.1. --- What is the problem? When `s3_enable_access_control_tags` is enabled, S3 uploads are tagged with a configurable access control tag (default key: `discourse:acl`) to indicate visibility. During multipart upload completion and file copies, `S3Helper#copy` receives a `tagging` option with the desired tags for the destination object. However, AWS S3 defaults `tagging_directive` to "COPY", which preserves the source object's tags instead of applying the new ones. This causes uploads to retain incorrect access control tags after being copied. What is the solution? Set `tagging_directive: "REPLACE"` in `S3Helper#copy` whenever `options[:tagging]` is present. This mirrors the existing `metadata_directive: "REPLACE"` pattern already used for metadata and tells the S3 API to apply the provided tags to the destination object. Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com> |
||
|---|---|---|
| .. | ||
| base_store_spec.rb | ||
| local_store_spec.rb | ||
| s3_store_spec.rb | ||