From 66c4ed7957459de270cffedfd494562359386d4e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 1 Jun 2023 21:19:35 +0000 Subject: chunk unterminated HTTP/1.1 responses Rack::Chunked will be gone in Rack 3.1, so provide a non-middleware fallback which takes advantage of IO#write supporting multiple arguments in Ruby 2.5+. We still need to support Ruby 2.4, at least, since Rack 3.0 does. So a new (GC-unfriendly) Unicorn::WriteSplat module now exists for Ruby <= 2.4 users. --- test/unit/test_server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/test_server.rb b/test/unit/test_server.rb index 98e85ab..fe98fcc 100644 --- a/test/unit/test_server.rb +++ b/test/unit/test_server.rb @@ -196,7 +196,7 @@ class WebServerTest < Test::Unit::TestCase # continue to process our request and never hit EOFError on our sock sock.shutdown(Socket::SHUT_WR) buf = sock.read - assert_equal 'hello!\n', buf.split(/\r\n\r\n/).last + assert_match %r{\bhello!\\n\b}, buf.split(/\r\n\r\n/, 2).last next_client = Net::HTTP.get(URI.parse("http://127.0.0.1:#@port/")) assert_equal 'hello!\n', next_client lines = File.readlines("test_stderr.#$$.log") -- cgit v1.2.3-24-ge0c7