mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 18:26:30 +00:00
Fix content-type response (#1017)
This commit is contained in:
parent
c2deabb672
commit
d90426f745
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user