diff options
author | Bryan Newbold <bnewbold@archive.org> | 2019-12-27 16:21:43 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-01-02 18:12:58 -0800 |
commit | 24df2167b294973ce230199370b7b061e6ae4498 (patch) | |
tree | 5839a9782acb7c30ca2f17f0c9b05e87824b267d /python | |
parent | fe8c71f7f942a02ed144847cca8149486ceaee9a (diff) | |
download | sandcrawler-24df2167b294973ce230199370b7b061e6ae4498.tar.gz sandcrawler-24df2167b294973ce230199370b7b061e6ae4498.zip |
set mimetype when PUT to minio
Diffstat (limited to 'python')
-rw-r--r-- | python/sandcrawler/minio.py | 4 |
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) |