Bug #9986 » webrick_transfer_encoding_chunked_content_length.patch
lib/webrick/httpresponse.rb | ||
---|---|---|
# Will this response body be returned using chunked transfer-encoding?
|
||
def chunked?
|
||
@chunked
|
||
if @header['transfer-encoding'] == 'chunked'
|
||
@chunked = true
|
||
else
|
||
@chunked
|
||
end
|
||
end
|
||
##
|
test/webrick/test_httpresponse.rb | ||
---|---|---|
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'
|