Fix PutMetadata with S3 backend (#176)

It turns out that the S3 API expects the additional `MetadataDirective:
REPLACE` option in order to update metadata. If this is not provided,
then metadata will simply be copied from the source object, which is not
what we wanted.
This commit is contained in:
mutantmonkey 2019-05-09 16:13:58 +00:00 committed by Andrei Marcu
parent 8098b7e39e
commit 872340e0dc
1 changed files with 5 additions and 4 deletions

View File

@ -152,6 +152,7 @@ func (b S3Backend) PutMetadata(key string, m backends.Metadata) (err error) {
Key: aws.String(key), Key: aws.String(key),
CopySource: aws.String("/" + b.bucket + "/" + key), CopySource: aws.String("/" + b.bucket + "/" + key),
Metadata: mapMetadata(m), Metadata: mapMetadata(m),
MetadataDirective: aws.String("REPLACE"),
}) })
if err != nil { if err != nil {
return return