Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Strip square brackets when creating IPv6 sockets

  • Loading branch information...
commit 88388973c430b171477a435bac504c8568b6ea56 1 parent bebc63c
@jsherwood0 jsherwood0 authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/httpclient/session.rb
View
8 lib/httpclient/session.rb
@@ -797,12 +797,14 @@ def create_socket(site)
socket = nil
begin
@debug_dev << "! CONNECT TO #{site.host}:#{site.port}\n" if @debug_dev
+ clean_host = site.host.delete("[]")
+ clean_local = @socket_local.host.delete("[]")
if str = @test_loopback_http_response.shift
- socket = LoopBackSocket.new(site.host, site.port, str)
+ socket = LoopBackSocket.new(clean_host, site.port, str)
elsif @socket_local == Site::EMPTY
- socket = TCPSocket.new(site.host, site.port)
+ socket = TCPSocket.new(clean_host, site.port)
else
- socket = TCPSocket.new(site.host, site.port, @socket_local.host, @socket_local.port)
+ socket = TCPSocket.new(clean_host, site.port, clean_local, @socket_local.port)
end
if @debug_dev
@debug_dev << "! CONNECTION ESTABLISHED\n"
Please sign in to comment.
Something went wrong with that request. Please try again.