summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-01-31 09:56:27 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2021-01-31 09:56:27 +0000
commit8b49c3e4bc767bec8a66ac81cbda033330fb2703 (patch)
tree5d1076ac5e0f06189dc517533bd9422619d3ec14 /test
parent092aeb28fc5a13fb9ed1d4b7675f3c33e970f1d3 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/webrick/test_httpproxy.rb2
-rw-r--r--test/webrick/test_httpserver.rb2
-rw-r--r--test/webrick/test_server.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/test/webrick/test_httpproxy.rb b/test/webrick/test_httpproxy.rb
index a9f6f7d610..504eb1f915 100644
--- a/test/webrick/test_httpproxy.rb
+++ b/test/webrick/test_httpproxy.rb
@@ -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}")
diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb
index a6e70da7e8..2e5d44940c 100644
--- a/test/webrick/test_httpserver.rb
+++ b/test/webrick/test_httpserver.rb
@@ -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)
diff --git a/test/webrick/test_server.rb b/test/webrick/test_server.rb
index 5f7f3a0b58..8162a186db 100644
--- a/test/webrick/test_server.rb
+++ b/test/webrick/test_server.rb
@@ -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)