pgjones / hypercorn

Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.
MIT License
1.12k stars 102 forks source link

set end_stream=True when sending trailers #255

Open adambudziak opened 4 weeks ago

adambudziak commented 4 weeks ago

Explanation in https://github.com/pgjones/hypercorn/issues/254

If the approach is approved (I assume details might be wrong) then I'll gladly add some tests to prevent regressions.

I ran tox and only mypy seems to be failing.

I tested manually with some grpc clients and they show the response properly (I tested unary and streaming responses and it looks good)

Not sure how to handle it with more_trailers=True, but I don't understand how it's supposed to work in general since http2 requires END_STREAM being set for trailers frame (I assume that more_trailers implies a new frame, but maybe not?)