From 1ff458ec27554e24441660e99bfc13782fb8d649 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sat, 20 Apr 2024 22:23:03 +1200 Subject: [PATCH] Invoke `flush` before `close_write` in `write_body_and_close`. (#33) It does not appear guaranteed that `close_write` will flush the underlying IO buffers, so let's ensure it's flushed. --- lib/protocol/http1/connection.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/protocol/http1/connection.rb b/lib/protocol/http1/connection.rb index 1eb8e10..b974be2 100644 --- a/lib/protocol/http1/connection.rb +++ b/lib/protocol/http1/connection.rb @@ -379,6 +379,7 @@ def write_body_and_close(body, head) end end + @stream.flush @stream.close_write end