Skip to content

Commit 50057c4

Browse files
adambudziakpgjones
authored andcommitted
set end_stream when sending trailers
1 parent 09722ac commit 50057c4

File tree

1 file changed

+4
-1
lines changed
  • src/hypercorn/protocol

1 file changed

+4
-1
lines changed

src/hypercorn/protocol/h2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ async def stream_send(self, event: StreamEvent) -> None:
215215
await self.has_data.set()
216216
await self.stream_buffers[event.stream_id].drain()
217217
elif isinstance(event, Trailers):
218-
self.connection.send_headers(event.stream_id, event.headers)
218+
self.priority.unblock(event.stream_id)
219+
await self.has_data.set()
220+
await self.stream_buffers[event.stream_id].drain()
221+
self.connection.send_headers(event.stream_id, event.headers, end_stream=True)
219222
await self._flush()
220223
elif isinstance(event, StreamClosed):
221224
await self._close_stream(event.stream_id)

0 commit comments

Comments
 (0)