From eb30c894c37d11fb6bbb67767335c10b52ec93d8 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Thu, 30 Sep 2021 01:33:35 +0000 Subject: [PATCH] Fix charset usage --- irclog.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/irclog.py b/irclog.py index e5a1a88..a2e34e2 100644 --- a/irclog.py +++ b/irclog.py @@ -943,7 +943,7 @@ class WebServer: if hidden: continue lines.append(f'{"(PW) " if auth else ""}{html.escape(channel)} (today's log, search)') - return aiohttp.web.Response(text = f'IRC logs{"
".join(lines)}', content_type = 'text/html; charset=UTF-8') + return aiohttp.web.Response(text = f'IRC logs{"
".join(lines)}', content_type = 'text/html', charset = 'UTF-8') async def get_status(self, request): self.logger.info(f'Received request {id(request)} from {request.remote!r} for {request.path!r}') @@ -970,7 +970,8 @@ class WebServer: '', '' ]), - content_type = 'text/html; charset=UTF-8' + content_type = 'text/html', + charset = 'UTF-8', ) def _file_iter_with_path(self, fn, path): @@ -1065,7 +1066,8 @@ class WebServer: '', '', ]).encode('utf-8', errors = 'surrogateescape'), - content_type = 'text/html; charset=UTF-8' + content_type = 'text/html', + charset = 'UTF-8', ) async def log_redirect_today(self, request): @@ -1105,7 +1107,8 @@ class WebServer: '', '' ]), - content_type = 'text/html; charset=UTF-8' + content_type = 'text/html', + charset = 'UTF-8', ) # Run the search with grep, limiting memory use, output size, and runtime and setting the niceness. @@ -1207,7 +1210,8 @@ class WebServer: '', '' ]).encode('utf-8', errors = 'surrogateescape'), - content_type = 'text/html; charset=UTF-8' + content_type = 'text/html', + charset = 'UTF-8', )