mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-18 22:56:31 +00:00
Add X-Accel-Buffering to disable buffers in proxies (#5544)
This commit is contained in:
parent
b07236b544
commit
bd156ebb53
@ -258,6 +258,7 @@ class APIHost(CoreSysAttributes):
|
||||
if not headers_returned:
|
||||
if cursor:
|
||||
response.headers["X-First-Cursor"] = cursor
|
||||
response.headers["X-Accel-Buffering"] = "no"
|
||||
await response.prepare(request)
|
||||
headers_returned = True
|
||||
# When client closes the connection while reading busy logs, we
|
||||
|
@ -277,6 +277,7 @@ class APIIngress(CoreSysAttributes):
|
||||
response.content_type = content_type
|
||||
|
||||
try:
|
||||
response.headers["X-Accel-Buffering"] = "no"
|
||||
await response.prepare(request)
|
||||
async for data in result.content.iter_chunked(4096):
|
||||
await response.write(data)
|
||||
|
@ -95,6 +95,7 @@ class APIProxy(CoreSysAttributes):
|
||||
response = web.StreamResponse()
|
||||
response.content_type = request.headers.get(CONTENT_TYPE)
|
||||
try:
|
||||
response.headers["X-Accel-Buffering"] = "no"
|
||||
await response.prepare(request)
|
||||
async for data in client.content:
|
||||
await response.write(data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user