aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2019-12-27 16:21:43 -0800
committerBryan Newbold <bnewbold@archive.org>2020-01-02 18:12:58 -0800
commit24df2167b294973ce230199370b7b061e6ae4498 (patch)
tree5839a9782acb7c30ca2f17f0c9b05e87824b267d /python
parentfe8c71f7f942a02ed144847cca8149486ceaee9a (diff)
downloadsandcrawler-24df2167b294973ce230199370b7b061e6ae4498.tar.gz
sandcrawler-24df2167b294973ce230199370b7b061e6ae4498.zip
set mimetype when PUT to minio
Diffstat (limited to 'python')
-rw-r--r--python/sandcrawler/minio.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/sandcrawler/minio.py b/python/sandcrawler/minio.py
index 25518f4..41dd29a 100644
--- a/python/sandcrawler/minio.py
+++ b/python/sandcrawler/minio.py
@@ -63,11 +63,15 @@ class SandcrawlerMinioClient(object):
if not bucket:
bucket = self.default_bucket
assert bucket
+ content_type = "application/octet-stream"
+ if extension.endswith('.xml'):
+ content_type = "application/xml"
self.mc.put_object(
bucket,
obj_path,
io.BytesIO(blob),
len(blob),
+ content_type=content_type,
)
return (bucket, obj_path)