summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-24 15:04:36 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-24 15:04:36 +0000
commitae2b1d2fe1fbb43f46588a949c892576a0918e54 (patch)
tree226c72bb4457fc6784390c03961794e0381813ac
parentceab943d087a8049b5ed72a77e88d151c1183e9a (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_2@52738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--lib/net/http.rb6
-rw-r--r--test/net/http/test_http.rb16
-rw-r--r--version.h6
4 files changed, 32 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d6e2b87d0d..773931cb16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Wed Nov 25 00:03:42 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * Added missing reference of GitHub
+
+Wed Nov 25 00:03:42 2015 Trevor Rowe <trevorrowe@gmail.com>
+
+ * lib/net/http.rb: Fixed regression for Net::HTTP::PUT with "Expect-100"
+ header. [fix GH-949]
+ * test/net/http/test_http.rb: added test.
+
Mon Nov 23 00:19:51 2015 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c (vm_invoke_block): we should not expect ci->argc is
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 03823ae735..ee4f28d6b6 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -1417,11 +1417,11 @@ module Net #:nodoc:
res.uri = req.uri
- res.reading_body(@socket, req.response_body_permitted?) {
- yield res if block_given?
- }
res
}
+ res.reading_body(@socket, req.response_body_permitted?) {
+ yield res if block_given?
+ }
rescue Net::OpenTimeout
raise
rescue Net::ReadTimeout, IOError, EOFError,
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 9d5cf3972b..a4104f43e5 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -826,6 +826,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
diff --git a/version.h b/version.h
index 1f85640018..3c74f93551 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.2.4"
-#define RUBY_RELEASE_DATE "2015-11-23"
-#define RUBY_PATCHLEVEL 194
+#define RUBY_RELEASE_DATE "2015-11-25"
+#define RUBY_PATCHLEVEL 195
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 11
-#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_DAY 25
#include "ruby/version.h"