Project

General

Profile

Bug #14466 ยป net-http-epipe.patch

jeremyevans0 (Jeremy Evans), 06/20/2019 08:03 PM

View differences:

lib/net/http.rb
begin
begin_transport req
res = catch(:response) {
req.exec @socket, @curr_http_version, edit_path(req.path)
begin
req.exec @socket, @curr_http_version, edit_path(req.path)
rescue Errno::EPIPE
# Failure when writing full request, but we can probably
# still read the received response.
end
begin
res = HTTPResponse.read_new(@socket)
res.decode_content = req.decode_content
test/net/http/test_http.rb
Net::HTTP.version_1_2
super
end
def test_send_large_POST_request
start {|http|
data = ' '*6000000
res = http.send_request('POST', '/', data, 'content-type' => 'application/x-www-form-urlencoded')
assert_kind_of Net::HTTPResponse, res
assert_kind_of String, res.body
assert_equal data.size, res.body.size
assert_equal data, res.body
}
end
end
class TestNetHTTP_v1_2_chunked < Test::Unit::TestCase
    (1-1/1)