From c3720d077845cf2d48e7454474c6ae9c8c54a45d Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 1 Feb 2024 16:04:28 +0100 Subject: [PATCH] ensure utf is used for all text-based responses --- owrx/controllers/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/owrx/controllers/__init__.py b/owrx/controllers/__init__.py index bb929cea..0dd4e3c6 100644 --- a/owrx/controllers/__init__.py +++ b/owrx/controllers/__init__.py @@ -20,6 +20,8 @@ class Controller(object): headers = {} if content_type is not None: headers["Content-Type"] = content_type + if content_type.startswith("text/"): + headers["Content-Type"] += "; charset=utf-8" if last_modified is not None: headers["Last-Modified"] = last_modified.astimezone(tz=timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT") if max_age is not None: