asgiref
asgiref copied to clipboard
RE: Add HTTP Trailers
There is already a PR open regarding this. I wanted to open this to add options to the discussion. I did the uvicorn implementation.
As stated in the other proposal PR this works a bit differently. This adds a new message type http.response.trailers
and a new trailers
bool property to http.response.start
. IMO this simplifies the implementation.
My original POC did not account for chunked trailers but this would be easy to add with a more_trailers
property similar to the more_body
property.
Personally I like the more_body
being set to false when the body is done and trailers being sent after. It makes more sense to me, but at the end of the day if any trailers get added I will be happy.
I do like this in general, but I feel like we need a more_trailers
in there because people are inevitably going to want that?
This can be closed. It was already merged on https://github.com/django/asgiref/pull/339.