#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>