1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Fix content-type response (#1017)

This commit is contained in:
Pascal Vizeli
2019-04-07 22:13:31 +02:00
committed by GitHub
parent c2deabb672
commit d90426f745

View File

@@ -131,7 +131,12 @@ class APIIngress(CoreSysAttributes):
):
# Return Response
body = await result.read()
return web.Response(headers=headers, status=result.status, body=body)
return web.Response(
headers=headers,
status=result.status,
content_type=result.content_type,
body=body,
)
# Stream response
response = web.StreamResponse(status=result.status, headers=headers)
@@ -156,12 +161,7 @@ def _init_header(
# filter flags
for name, value in request.headers.items():
if name in (
hdrs.CONTENT_LENGTH,
hdrs.CONTENT_TYPE,
hdrs.CONTENT_ENCODING,
istr(HEADER_TOKEN),
):
if name in (hdrs.CONTENT_LENGTH, hdrs.CONTENT_ENCODING, istr(HEADER_TOKEN)):
continue
headers[name] = value