mirror of
https://github.com/django/daphne.git
synced 2025-04-20 08:42:18 +03:00
Fix streaming responses (e.g. staticfiles.serve)
This commit is contained in:
parent
e666355fad
commit
247a26b91a
|
@ -242,8 +242,10 @@ class AsgiHandler(base.BaseHandler):
|
|||
# Streaming responses need to be pinned to their iterator
|
||||
if response.streaming:
|
||||
for part in response.streaming_content:
|
||||
for chunk in cls.chunk_bytes(part):
|
||||
for chunk, more in cls.chunk_bytes(part):
|
||||
message['content'] = chunk
|
||||
# We ignore "more" as there may be more parts; instead,
|
||||
# we use an empty final closing message with False.
|
||||
message['more_content'] = True
|
||||
yield message
|
||||
message = {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user