ruby-changes:44714
From: usa <ko1@a...>
Date: Tue, 15 Nov 2016 03:40:35 +0900 (JST)
Subject: [ruby-changes:44714] usa:r56787 (ruby_2_2): merge revision(s) 56596: [Backport #12890]
usa 2016-11-15 03:40:30 +0900 (Tue, 15 Nov 2016) New Revision: 56787 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56787 Log: merge revision(s) 56596: [Backport #12890] * lib/net/http.rb (transport_request): other than HTTPContinue in 1xx (HTTPInformation) also needs to continue. [Bug #12890] Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/lib/net/http.rb branches/ruby_2_2/test/net/http/test_http.rb branches/ruby_2_2/version.h Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 56786) +++ ruby_2_2/ChangeLog (revision 56787) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Tue Nov 15 03:39:07 2016 NARUSE, Yui <naruse@r...> + + * lib/net/http.rb (transport_request): other than HTTPContinue + in 1xx (HTTPInformation) also needs to continue. [Bug #12890] + Sat Nov 12 07:48:07 2016 Nobuyoshi Nakada <nobu@r...> * proc.c (mnew_internal): follow the original class, not to loop Index: ruby_2_2/lib/net/http.rb =================================================================== --- ruby_2_2/lib/net/http.rb (revision 56786) +++ ruby_2_2/lib/net/http.rb (revision 56787) @@ -1413,7 +1413,7 @@ module Net #:nodoc: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/net/http.rb#L1413 begin res = HTTPResponse.read_new(@socket) res.decode_content = req.decode_content - end while res.kind_of?(HTTPContinue) + end while res.kind_of?(HTTPInformation) res.uri = req.uri Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 56786) +++ ruby_2_2/version.h (revision 56787) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-11-15" -#define RUBY_PATCHLEVEL 392 +#define RUBY_PATCHLEVEL 393 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_2/test/net/http/test_http.rb =================================================================== --- ruby_2_2/test/net/http/test_http.rb (revision 56786) +++ ruby_2_2/test/net/http/test_http.rb (revision 56787) @@ -870,6 +870,39 @@ class TestNetHTTPContinue < Test::Unit:: https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/net/http/test_http.rb#L870 end end +class TestNetHTTPSwitchingProtocols < Test::Unit::TestCase + CONFIG = { + 'host' => '127.0.0.1', + 'proxy_host' => nil, + 'proxy_port' => nil, + 'chunked' => true, + } + + include TestNetHTTPUtils + + def logfile + @debug = StringIO.new('') + end + + def mount_proc(&block) + @server.mount('/continue', WEBrick::HTTPServlet::ProcHandler.new(block.to_proc)) + end + + def test_info + mount_proc {|req, res| + req.instance_variable_get(:@socket) << "HTTP/1.1 101 Switching Protocols\r\n\r\n" + res.body = req.query['body'] + } + start {|http| + http.continue_timeout = 0.2 + http.request_post('/continue', 'body=BODY') {|res| + assert_equal('BODY', res.read_body) + } + } + assert_match(/HTTP\/1.1 101 Switching Protocols/, @debug.string) + end +end + class TestNetHTTPKeepAlive < Test::Unit::TestCase CONFIG = { 'host' => '127.0.0.1', Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r56596 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/