mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
making sure that addresses map to proper addrinfo when in tcp mode
This commit is contained in:
parent
e34c998f5a
commit
cad4079cb3
@ -16,7 +16,6 @@ module HTTPX
|
||||
def initialize(origin, addresses, options)
|
||||
@state = :idle
|
||||
@hostname = origin.host
|
||||
@addresses = addresses
|
||||
@options = Options.new(options)
|
||||
@fallback_protocol = @options.fallback_protocol
|
||||
@port = origin.port
|
||||
@ -36,8 +35,9 @@ module HTTPX
|
||||
@keep_open = true
|
||||
@state = :connected
|
||||
else
|
||||
@ip_index = @addresses.size - 1
|
||||
@addresses = addresses.map { |addr| addr.is_a?(IPAddr) ? addr : IPAddr.new(addr) }
|
||||
end
|
||||
@ip_index = @addresses.size - 1
|
||||
@io ||= build_socket
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user