mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-08 03:18:28 +03:00
expand S3 objects content type for better preview results in non-latin languages
This commit is contained in:
@@ -40,6 +40,8 @@ class S3Storage(Storage):
|
||||
try:
|
||||
if media.mimetype:
|
||||
extra_args["ContentType"] = media.mimetype
|
||||
if "text" in media.mimetype:
|
||||
extra_args["ContentType"] += "; charset=utf-8"
|
||||
except Exception as e:
|
||||
logger.warning(f"Unable to get mimetype for {media.key=}, error: {e}")
|
||||
self.s3.upload_fileobj(file, Bucket=self.bucket, Key=media.key, ExtraArgs=extra_args)
|
||||
|
||||
Reference in New Issue
Block a user