lib/httpx/io/unix.rb in httpx-1.2.4 vs lib/httpx/io/unix.rb in httpx-1.2.6
- old
+ new
@@ -6,11 +6,11 @@
attr_reader :path
alias_method :host, :path
- def initialize(origin, addresses, options)
+ def initialize(origin, path, options)
@addresses = []
@hostname = origin.host
@state = :idle
@options = Options.new(options)
@fallback_protocol = @options.fallback_protocol
@@ -24,11 +24,13 @@
raise Error, "Given IO objects do not match the request authority" unless @io
@path = @io.path
@keep_open = true
@state = :connected
+ elsif path
+ @path = path
else
- @path = addresses.first
+ raise Error, "No path given where to store the socket"
end
@io ||= build_socket
end
def connect