summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 11:56:05 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 11:56:05 +0000
commit0f5bf067263d662ad57e41bea7665230ab6fafc7 (patch)
treec266ae4f7a831ac30f092bf637a88cd707d8dbdc /test
parent18d73ae8151ff259fe8e4aac8f228173dbe57924 (diff)
merge revision(s) 52683,52684: [Backport #11719] [Backport #11722]
* lib/net/http.rb: Fixed regression for Net::HTTP::PUT with "Expect-100" header. * test/net/http/test_http.rb: added test. * Added missing reference of GitHub header. [fix GH-949] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@52796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/net/http/test_http.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 60d9d76150..033f369553 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -822,6 +822,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