summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-11 19:40:15 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-11 19:40:15 +0100
commit841f5a5a5beeecc4579bc91ac796cb44fdc7b47f (patch)
treef69167841328a5d32d50f653f4c2460feb685fa2
parent0c6de5e97284c76f6a1b881fdecbda41ec38f8f9 (diff)
downloadslixmpp-841f5a5a5beeecc4579bc91ac796cb44fdc7b47f.tar.gz
slixmpp-841f5a5a5beeecc4579bc91ac796cb44fdc7b47f.tar.bz2
slixmpp-841f5a5a5beeecc4579bc91ac796cb44fdc7b47f.tar.xz
slixmpp-841f5a5a5beeecc4579bc91ac796cb44fdc7b47f.zip
xep_0363: Only send the basename() of the filename to the server.
-rw-r--r--slixmpp/plugins/xep_0363/http_upload.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/slixmpp/plugins/xep_0363/http_upload.py b/slixmpp/plugins/xep_0363/http_upload.py
index 0fc91f4e..0cca2d08 100644
--- a/slixmpp/plugins/xep_0363/http_upload.py
+++ b/slixmpp/plugins/xep_0363/http_upload.py
@@ -8,6 +8,7 @@
import asyncio
import logging
+import os.path
from aiohttp import ClientSession
from mimetypes import guess_type
@@ -128,7 +129,8 @@ class XEP_0363(BasePlugin):
if content_type is None:
content_type = self.default_content_type
- slot_iq = await self.request_slot(self.upload_service, filename, size,
+ basename = os.path.basename(filename)
+ slot_iq = await self.request_slot(self.upload_service, basename, size,
content_type, ifrom, timeout)
slot = slot_iq['http_upload_slot']