summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 16cac6f222..b39a4c0acc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Nov 30 20:54:22 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * Added missing reference of GitHub
+
+Mon Nov 30 20:54:22 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.
+
Wed Nov 18 20:56:50 2015 NARUSE, Yui <naruse@ruby-lang.org>
* ext/date/extconf.rb: try_cflags("-std=iso9899:1999") [Bug #10906]
diff --git a/lib/net/http.rb b/lib/net/http.rb
index bd0a4d6b5f..b841858ffd 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 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
diff --git a/version.h b/version.h
index a9c9cde83a..a6029249e5 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.1.8"
-#define RUBY_RELEASE_DATE "2015-11-18"
-#define RUBY_PATCHLEVEL 421
+#define RUBY_RELEASE_DATE "2015-11-30"
+#define RUBY_PATCHLEVEL 422
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 11
-#define RUBY_RELEASE_DAY 18
+#define RUBY_RELEASE_DAY 30
#include "ruby/version.h"