summaryrefslogtreecommitdiff
path: root/test/webrick/test_httpresponse.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-08-11 12:57:11 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-30 17:50:13 +0900
commita98632d5c20e41e05074384b8f760af407e6d52a (patch)
treee4c77657b6db0e30735ff18c77059d2b8ddb9e07 /test/webrick/test_httpresponse.rb
parentedfbffb241a894eece57155a22a89637b33cfe58 (diff)
[ruby/webrick] Enabled chunked encoding if Transfer-Encoding: chunked header is set
Patch from Leonard Garvey. Fixes Ruby Bug 9986. https://github.com/ruby/webrick/commit/8cff7f3995
Diffstat (limited to 'test/webrick/test_httpresponse.rb')
-rw-r--r--test/webrick/test_httpresponse.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/webrick/test_httpresponse.rb b/test/webrick/test_httpresponse.rb
index 696163b..e8c69a1 100644
--- a/test/webrick/test_httpresponse.rb
+++ b/test/webrick/test_httpresponse.rb
@@ -133,6 +133,13 @@ module WEBrick
assert_equal 0, logger.messages.length
end
+ def test_200_chunked_does_not_set_content_length
+ 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'