xep_0363: Only send the basename() of the filename to the server.

This commit is contained in:
Emmanuel Gil Peyrot 2018-03-11 19:40:15 +01:00
parent 0c6de5e972
commit 841f5a5a5b

View File

@ -8,6 +8,7 @@
import asyncio import asyncio
import logging import logging
import os.path
from aiohttp import ClientSession from aiohttp import ClientSession
from mimetypes import guess_type from mimetypes import guess_type
@ -128,7 +129,8 @@ class XEP_0363(BasePlugin):
if content_type is None: if content_type is None:
content_type = self.default_content_type 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) content_type, ifrom, timeout)
slot = slot_iq['http_upload_slot'] slot = slot_iq['http_upload_slot']