1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Backport webrick patch for CVE-2020-25613

[Backport #17201]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2021-01-31 09:56:27 +00:00
parent 092aeb28fc
commit 8b49c3e4bc
6 changed files with 8 additions and 8 deletions

View file

@ -226,9 +226,9 @@ module WEBrick
raise HTTPStatus::BadRequest, "bad URI `#{@unparsed_uri}'."
end
if /close/io =~ self["connection"]
if /\Aclose\z/io =~ self["connection"]
@keep_alive = false
elsif /keep-alive/io =~ self["connection"]
elsif /\Akeep-alive\z/io =~ self["connection"]
@keep_alive = true
elsif @http_version < "1.1"
@keep_alive = false
@ -503,7 +503,7 @@ module WEBrick
return unless socket
if tc = self['transfer-encoding']
case tc
when /chunked/io then read_chunked(socket, block)
when /\Achunked\z/io then read_chunked(socket, block)
else raise HTTPStatus::NotImplemented, "Transfer-Encoding: #{tc}."
end
elsif self['content-length'] || @remaining_size

View file

@ -14,5 +14,5 @@ module WEBrick
##
# The WEBrick version
VERSION = "1.4.2"
VERSION = "1.4.4"
end

View file

@ -213,7 +213,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase
end
end
end
end
end if RUBY_VERSION >= '2.5'
def make_certificate(key, cn)
subject = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=#{cn}")

View file

@ -253,7 +253,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
server.virtual_host(WEBrick::HTTPServer.new(vhost_config))
Thread.pass while server.status != :Running
sleep 1 if RubyVM::MJIT.enabled? # server.status behaves unexpectedly with --jit-wait
sleep 1 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # server.status behaves unexpectedly with --jit-wait
assert_equal(1, started, log.call)
assert_equal(0, stopped, log.call)
assert_equal(0, accepted, log.call)

View file

@ -65,7 +65,7 @@ class TestWEBrickServer < Test::Unit::TestCase
}
TestWEBrick.start_server(Echo, config){|server, addr, port, log|
true while server.status != :Running
sleep 1 if RubyVM::MJIT.enabled? # server.status behaves unexpectedly with --jit-wait
sleep 1 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # server.status behaves unexpectedly with --jit-wait
assert_equal(1, started, log.call)
assert_equal(0, stopped, log.call)
assert_equal(0, accepted, log.call)

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.6.7"
#define RUBY_RELEASE_DATE "2021-01-31"
#define RUBY_PATCHLEVEL 152
#define RUBY_PATCHLEVEL 153
#define RUBY_RELEASE_YEAR 2021
#define RUBY_RELEASE_MONTH 1