aboutsummaryrefslogtreecommitdiff
path: root/mu4web/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'mu4web/main.py')
-rw-r--r--mu4web/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mu4web/main.py b/mu4web/main.py
index c147ab7..5d2d975 100644
--- a/mu4web/main.py
+++ b/mu4web/main.py
@@ -149,7 +149,7 @@ def page_base(title: Optional[str] = None,
('meta', {'name': 'viewport',
'content': 'width=device-width, initial-scale=0.5'}),
('title', title, ' — Mu4Web'),
- include_stylesheet(url_for('static', 'style.css')),
+ include_stylesheet(url_for('static', filename='style.css')),
),
('body',
('nav',
@@ -420,7 +420,7 @@ def attachement_response(attachement: EmailMessage):
Gets content type and encoding from the attachements headers.
"""
response = flask.Response()
- response.charset = attachement.get_content_charset()
+ response.charset = attachement.get_content_charset() or 'application/binary'
response.mimetype = attachement.get_content_type()
# does get_content do stuff depending on content-type?
# Check how to explicitly get the raw bytes.
@@ -500,7 +500,7 @@ class IMGParser(HTMLParser):
self.result += f' {key}="{data}"'
key = 'src'
- data = url_for('static', 'content-blocked.svg')
+ data = url_for('static', filename='content-blocked.svg')
self.result += f' {key}="{data}"'
else:
key = html.escape(key)
@@ -571,7 +571,7 @@ def attachement_part_page():
# above, which unblocks it.
# TODO this "fails" for images wrapped in anchor tags, since
# the anchor tag has priority.
- url = url_for('static', 'enable_images.js')
+ url = url_for('static', filename='enable_images.js')
result += f"\n<script src='{url}'></script>"
return str(result)