ensure utf is used for all text-based responses
This commit is contained in:
parent
3ec71e7758
commit
c3720d0778
|
|
@ -20,6 +20,8 @@ class Controller(object):
|
||||||
headers = {}
|
headers = {}
|
||||||
if content_type is not None:
|
if content_type is not None:
|
||||||
headers["Content-Type"] = content_type
|
headers["Content-Type"] = content_type
|
||||||
|
if content_type.startswith("text/"):
|
||||||
|
headers["Content-Type"] += "; charset=utf-8"
|
||||||
if last_modified is not None:
|
if last_modified is not None:
|
||||||
headers["Last-Modified"] = last_modified.astimezone(tz=timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")
|
headers["Last-Modified"] = last_modified.astimezone(tz=timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")
|
||||||
if max_age is not None:
|
if max_age is not None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue