Skip to content

Commit 9a10a36

Browse files
osyoyutaketo1113
authored andcommitted
Ruby 2 compat
1 parent 108b51a commit 9a10a36

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
@@ -1677,7 +1677,7 @@ def connect
16771677
# Use built-in timeout in TCPSocket.open if available
16781678
TCPSocket.open(conn_addr, conn_port, @local_host, @local_port, open_timeout: @open_timeout)
16791679
rescue ArgumentError => e
1680-
raise if !e.message.include?('unknown keyword: :open_timeout')
1680+
raise if !(e.message.include?('unknown keyword: :open_timeout') || e.message.include?('wrong number of arguments (given 5, expected 2..4)'))
16811681
# Fallback to Timeout.timeout if TCPSocket.open does not support open_timeout
16821682
Timeout.timeout(@open_timeout, Net::OpenTimeout) {
16831683
TCPSocket.open(conn_addr, conn_port, @local_host, @local_port)

0 commit comments

Comments
 (0)