Add content-type headers in response in ASGI mode

This commit is contained in:
Adam Hopkins
2019-08-11 11:27:59 +03:00
parent a15d9552c4
commit aa270d3ac2
2 changed files with 30 additions and 1 deletions

View File

@@ -328,6 +328,11 @@ class ASGIApp:
(b"content-length", str(len(response.body)).encode("latin-1"))
]
if "content-type" not in response.headers:
headers += [
(b"content-type", str(response.content_type).encode("latin-1"))
]
if response.cookies:
cookies.update(
{