Bug #15203 ยป ap_2018-10-04_1_test-webrick.patch
test/webrick/test_filehandler.rb | ||
---|---|---|
http.request(req){|res|
|
||
assert_equal("200", res.code, log.call)
|
||
assert_equal("text/plain", res.content_type, log.call)
|
||
assert_equal(File.read(__FILE__), res.body, log.call)
|
||
assert_equal(File.read(__FILE__), res.body.gsub(/\r/, ''), log.call)
|
||
}
|
||
req = Net::HTTP::Get.new("/#{this_file}", "range"=>"bytes=#{filesize-100}-")
|
test/webrick/test_httprequest.rb | ||
---|---|---|
msg << "0" << crlf
|
||
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
|
||
req.parse(StringIO.new(msg))
|
||
assert_equal(expect, req.body)
|
||
assert_equal(expect, req.body.gsub(/\r/, ''))
|
||
# chunked req.body_reader
|
||
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
|
||
req.parse(StringIO.new(msg))
|
||
dst = StringIO.new
|
||
IO.copy_stream(req.body_reader, dst)
|
||
assert_equal(expect, dst.string)
|
||
assert_equal(expect, dst.string.gsub(/\r/, ''))
|
||
end
|
||
def test_forwarded
|