From ab4992bf4a2011e0f5271718ca5f5bbba7583a01 Mon Sep 17 00:00:00 2001 From: Mathias Date: Wed, 20 Dec 2017 21:14:14 +0100 Subject: [PATCH] . --- muk_web_preview_mail/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/muk_web_preview_mail/controllers/main.py b/muk_web_preview_mail/controllers/main.py index 45cfaf2..9fae7a5 100644 --- a/muk_web_preview_mail/controllers/main.py +++ b/muk_web_preview_mail/controllers/main.py @@ -106,7 +106,7 @@ class MailParserController(http.Controller): return exception def _make_attachment_response(self, file, filename): - headers = [('Content-Type', mimetypes.guess_type(urllib.pathname2url(filename))[0]), + headers = [('Content-Type', mimetypes.guess_type(urllib..request.pathname2url(filename))[0]), ('Content-Disposition', 'attachment; filename="{}";'.format(filename)), ('Content-Length', len(file))] return request.make_response(file, headers) @@ -119,7 +119,7 @@ class MailParserController(http.Controller): else: attachments = [] for file in message["attachments"]: - mimetype = mimetypes.guess_type(urllib.pathname2url(file.fname))[0] + mimetype = mimetypes.guess_type(urllib..request.pathname2url(file.fname))[0] extension = os.path.splitext(file.fname)[1] link = self._set_query_parameter(url, "attachment", file.fname) attachments.append(self._Attachment(file.fname, mimetype, extension, link, file.info))