Merge "Fix a bug in s3 log uploader with .gz files"

This commit is contained in:
Zuul 2022-04-11 20:04:48 +00:00 committed by Gerrit Code Review
commit 3eb75563fe
1 changed files with 5 additions and 4 deletions

View File

@ -169,10 +169,11 @@ class Uploader():
content_encoding = file_detail.encoding
data = open(file_detail.full_path, 'rb')
extra_args = dict(
ContentType=file_detail.mimetype,
ContentEncoding=content_encoding
)
extra_args = {}
if file_detail.mimetype:
extra_args['ContentType'] = file_detail.mimetype
if content_encoding:
extra_args['ContentEncoding'] = content_encoding
if self.public:
extra_args['ACL'] = 'public-read'