Skip to content

Commit 09bf573

Browse files
committed
Ruby 2 compat
1 parent 728eb8f commit 09bf573

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ def connect
16591659
# Use built-in timeout in TCPSocket.open if available
16601660
TCPSocket.open(conn_addr, conn_port, @local_host, @local_port, open_timeout: @open_timeout)
16611661
rescue ArgumentError => e
1662-
raise if !e.message.include?('unknown keyword: :open_timeout')
1662+
raise if !(e.message.include?('unknown keyword: :open_timeout') || e.message.include?('wrong number of arguments (given 5, expected 2..4)'))
16631663
# Fallback to Timeout.timeout if TCPSocket.open does not support open_timeout
16641664
Timeout.timeout(@open_timeout, Net::OpenTimeout) {
16651665
TCPSocket.open(conn_addr, conn_port, @local_host, @local_port)

0 commit comments

Comments
 (0)