summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-11 19:39:51 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-11 19:39:51 +0100
commit0c6de5e97284c76f6a1b881fdecbda41ec38f8f9 (patch)
tree9d4ce94de97983cbf0a85250746ee74f9722ff90
parent81dc61c55c5ce9a3b13d104f0731059caf0b225a (diff)
downloadslixmpp-0c6de5e97284c76f6a1b881fdecbda41ec38f8f9.tar.gz
slixmpp-0c6de5e97284c76f6a1b881fdecbda41ec38f8f9.tar.bz2
slixmpp-0c6de5e97284c76f6a1b881fdecbda41ec38f8f9.tar.xz
slixmpp-0c6de5e97284c76f6a1b881fdecbda41ec38f8f9.zip
xep_0363: Simplify Content-Type guessing.
-rw-r--r--slixmpp/plugins/xep_0363/http_upload.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py
index c15fe66e..0fc91f4e 100644
--- a/slixmpp/plugins/xep_0363/http_upload.py
+++ b/slixmpp/plugins/xep_0363/http_upload.py
@@ -10,7 +10,7 @@ import asyncio
import logging
from aiohttp import ClientSession
-from mimetypes import MimeTypes
+from mimetypes import guess_type
from slixmpp import Iq, __version__
from slixmpp.plugins import BasePlugin
@@ -124,7 +124,7 @@ class XEP_0363(BasePlugin):
raise FileTooBig()
if content_type is None:
- content_type = MimeTypes().guess_type(filename)[0]
+ content_type = guess_type(filename)[0]
if content_type is None:
content_type = self.default_content_type