diff --git test/webrick/test_httpresponse.rb test/webrick/test_httpresponse.rb index 1f85a92..81b1268 100644 --- test/webrick/test_httpresponse.rb +++ test/webrick/test_httpresponse.rb @@ -47,6 +47,16 @@ module WEBrick assert_equal 0, logger.messages.length end + def test_200_chunked_does_not_set_content_length + res.body = 'hello' + res.status = 200 + res.chunked = false + res["Transfer-Encoding"] = 'chunked' + res.setup_header + + assert_nil res.header.fetch('content-length', nil) + end + def test_send_body_io IO.pipe {|body_r, body_w| body_w.write 'hello'