From f0002bd5a21bf091dfd0482fb7b0147b7d3703fb Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 20 Nov 2015 05:57:10 +0000 Subject: * lib/net/http.rb: Fixed regression for Net::HTTP::PUT with "Expect-100" header. * test/net/http/test_http.rb: added test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/net/http/test_http.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/net/http') diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 1bd085a90b..cfdf62191f 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -838,6 +838,22 @@ class TestNetHTTPContinue < Test::Unit::TestCase assert_not_match(/HTTP\/1.1 100 continue/, @debug.string) end + def test_expect_continue_error_before_body + @log_tester = nil + mount_proc {|req, res| + raise WEBrick::HTTPStatus::Forbidden + } + start {|http| + uheader = {'content-length' => '5', 'expect' => '100-continue'} + http.continue_timeout = 1 # allow the server to respond before sending + http.request_post('/continue', 'data', uheader) {|res| + assert_equal(res.code, '403') + } + } + assert_match(/Expect: 100-continue/, @debug.string) + assert_not_match(/HTTP\/1.1 100 continue/, @debug.string) + end + def test_expect_continue_error_while_waiting mount_proc {|req, res| res.status = 501 -- cgit v1.2.3