IO#sysread may only capture the 103 response and return before the server can send the 200. Since we don't support persistent connections, we can just use IO#read to rely on the server giving us an EOF after the 200 is sent.
Cc: Jean Boussier <[email protected]> --- test/unit/test_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb index d706243..384fa6b 100644 --- a/test/unit/test_server.rb +++ b/test/unit/test_server.rb @@ -106,7 +106,7 @@ def test_early_hints sock = TCPSocket.new('127.0.0.1', @port) sock.syswrite("GET / HTTP/1.0\r\n\r\n") - responses = sock.sysread(4096) + responses = sock.read(4096) assert_match %r{\AHTTP/1.[01] 103\b}, responses assert_match %r{^Link: </style\.css>}, responses assert_match %r{^Link: </script\.js>}, responses -- unsubscribe: one-click, see List-Unsubscribe header archive: https://yhbt.net/unicorn-public/
