[Django] #36628: StreamingHttpResponse doesn't send final ASGI more_body=False signal

4 views
Skip to first unread message

Django

unread,
Sep 26, 2025, 7:46:02 PM (5 days ago) Sep 26
to django-...@googlegroups.com
#36628: StreamingHttpResponse doesn't send final ASGI more_body=False signal
-------------------------------------+-------------------------------------
Reporter: LouisAmon | Owner: LouisAmon
Type: Bug | Status: assigned
Component: HTTP | Version: 5.2
handling | Keywords: streaming, vercel,
Severity: Normal | asgi
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
Django's StreamingHttpResponse does not send the final ASGI
more_body=False
signal when streaming responses are exhausted.

This causes compatibility issues with ASGI servers like Vercel's custom
handler that require this
signal to properly finalize responses.

Reference:
https://github.com/vercel/vercel/blob/main/packages/python/vc_init.py#L646
--
Ticket URL: <https://code.djangoproject.com/ticket/36628>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 26, 2025, 7:57:16 PM (5 days ago) Sep 26
to django-...@googlegroups.com
#36628: StreamingHttpResponse doesn't send final ASGI more_body=False signal
-------------------------------------+-------------------------------------
Reporter: LouisAmon | Owner: LouisAmon
Type: Bug | Status: assigned
Component: HTTP handling | Version: 5.2
Severity: Normal | Resolution:
Keywords: streaming, vercel, | Triage Stage:
asgi | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by LouisAmon):

* has_patch: 0 => 1

Comment:

https://github.com/django/django/pull/19905
--
Ticket URL: <https://code.djangoproject.com/ticket/36628#comment:1>

Django

unread,
Sep 29, 2025, 5:46:27 AM (2 days ago) Sep 29
to django-...@googlegroups.com
#36628: StreamingHttpResponse doesn't send final ASGI more_body=False signal
-------------------------------------+-------------------------------------
Reporter: Louis Amon | Owner: Louis
| Amon
Type: Bug | Status: assigned
Component: HTTP handling | Version: 5.2
Severity: Normal | Resolution:
Keywords: streaming, vercel, | Triage Stage:
asgi | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* cc: Carlton Gibson (added)

Comment:

Noting that #33738 is likely related, especially
[https://code.djangoproject.com/ticket/33738#comment:6 this comment].
--
Ticket URL: <https://code.djangoproject.com/ticket/36628#comment:2>

Django

unread,
Sep 29, 2025, 5:56:57 AM (2 days ago) Sep 29
to django-...@googlegroups.com
#36628: StreamingHttpResponse doesn't send final ASGI more_body=False signal
-------------------------------------+-------------------------------------
Reporter: Louis Amon | Owner: Louis
| Amon
Type: Bug | Status: assigned
Component: HTTP handling | Version: 5.2
Severity: Normal | Resolution:
Keywords: streaming, vercel, | Triage Stage:
asgi | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Carlton Gibson):

#33738 was about handling multiple body events when parsing the request.
This here is about the response. In both cases, a `more_body=True` entails
that there's more to come (but they're not otherwise related).

The [https://asgi.readthedocs.io/en/latest/specs/www.html#response-body-
send-event spec here for Response body events] is clear (my emphasis
added):

> `more_body (bool)` – Signifies if there is additional content to come
(as part of a Response Body message). If False, and the server is not
expecting Response Trailers response will be taken as complete and closed,
and any further messages on the channel will be ignored. **Optional; if
missing defaults to False**.

That is, if `more_body` is missing, it should be assumed to be `False`.
(It's **optional** and emitting it is not an error.)

Looking at
[https://github.com/vercel/vercel/blob/6661ea2ac385704601124e7ebe7596dcf95f0cc8/packages/python/vc_init.py#L641
the Vercel code, it already does this], so I can't quite see from the
information given what the problem is. 🤔
--
Ticket URL: <https://code.djangoproject.com/ticket/36628#comment:3>

Django

unread,
Sep 29, 2025, 8:22:20 AM (2 days ago) Sep 29
to django-...@googlegroups.com
#36628: StreamingHttpResponse doesn't send final ASGI more_body=False signal
-------------------------------------+-------------------------------------
Reporter: Louis Amon | Owner: Louis
| Amon
Type: Bug | Status: closed
Component: HTTP handling | Version: 5.2
Severity: Normal | Resolution: wontfix
Keywords: streaming, vercel, | Triage Stage:
asgi | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => wontfix
* status: assigned => closed

Comment:

Thank you Carlton
Louis you will need to add more information to explain the ticket and how
Django is at fault before reopening
--
Ticket URL: <https://code.djangoproject.com/ticket/36628#comment:4>
Reply all
Reply to author
Forward
0 new messages