diff --git a/ChangeLog b/ChangeLog index e81d653e1d..6e6de0f93d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Feb 14 14:31:43 2013 Eric Hodel + + * lib/net/http.rb: Removed OpenSSL dependency from Net::HTTP. + + * test/net/http/test_http.rb: Remove Zlib dependency from tests. + * test/net/http/test_http_request.rb: ditto. + Thu Feb 14 11:08:15 2013 Nobuyoshi Nakada * class.c (include_modules_at): detect cyclic prepend with original diff --git a/lib/net/http.rb b/lib/net/http.rb index 4b1a65767f..cc1b1c4a1f 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1424,7 +1424,9 @@ module Net #:nodoc: raise rescue Net::ReadTimeout, IOError, EOFError, Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPIPE, - OpenSSL::SSL::SSLError, Timeout::Error => exception + # avoid a dependency on OpenSSL + defined?(OpenSSL::SSL) ? OpenSSL::SSL::SSLError : IOError, + Timeout::Error => exception if count == 0 && IDEMPOTENT_METHODS_.include?(req.method) count += 1 @socket.close if @socket and not @socket.closed? diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb index 32c8744413..9a7300f481 100644 --- a/test/net/http/test_http.rb +++ b/test/net/http/test_http.rb @@ -442,7 +442,7 @@ module TestNetHTTP_version_1_2_methods assert_equal $test_net_http_data.size, res.body.size assert_equal $test_net_http_data, res.body - assert res.decode_content, 'Bug #7831' + assert res.decode_content, 'Bug #7831' if Net::HTTP::HAVE_ZLIB } end diff --git a/test/net/http/test_http_request.rb b/test/net/http/test_http_request.rb index 4ce93acde3..1dcb847c3f 100644 --- a/test/net/http/test_http_request.rb +++ b/test/net/http/test_http_request.rb @@ -62,7 +62,7 @@ class HTTPRequestTest < Test::Unit::TestCase refute req2.decode_content, 'Bug #7381 - do not decode content if the user overrides' - end + end if Net::HTTP::HAVE_ZLIB def test_header_set req = Net::HTTP::Get.new '/' @@ -73,7 +73,7 @@ class HTTPRequestTest < Test::Unit::TestCase refute req.decode_content, 'Bug #7831 - do not decode content if the user overrides' - end + end if Net::HTTP::HAVE_ZLIB end