diff --git a/lib/puma/server.rb b/lib/puma/server.rb index 39a5ab54..8149b77d 100644 --- a/lib/puma/server.rb +++ b/lib/puma/server.rb @@ -307,6 +307,7 @@ module Puma if chunked client.write "0" client.write line_ending + client.write line_ending client.flush end diff --git a/test/test_persistent.rb b/test/test_persistent.rb index 05de13f3..1059ea14 100644 --- a/test/test_persistent.rb +++ b/test/test_persistent.rb @@ -56,7 +56,7 @@ class TestPersistent < Test::Unit::TestCase @client << @valid_request - assert_equal "HTTP/1.1 200 OK\r\nX-Header: Works\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nHello\r\n7\r\nChunked\r\n0\r\n", lines(9) + assert_equal "HTTP/1.1 200 OK\r\nX-Header: Works\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nHello\r\n7\r\nChunked\r\n0\r\n\r\n", lines(10) end def test_no_chunked_in_http10 @@ -74,7 +74,7 @@ class TestPersistent < Test::Unit::TestCase @client << @valid_request - assert_equal "HTTP/1.1 200 OK\r\nX-Header: Works\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nHello\r\n#{str.size.to_s(16)}\r\n#{str}\r\n0\r\n", lines(9) + assert_equal "HTTP/1.1 200 OK\r\nX-Header: Works\r\nTransfer-Encoding: chunked\r\n\r\n5\r\nHello\r\n#{str.size.to_s(16)}\r\n#{str}\r\n0\r\n\r\n", lines(10) end