Merge "Fix ipv6 support"
This commit is contained in:
commit
bbeb24c51a
@ -30,7 +30,13 @@ end
|
|||||||
# A parsed URL (returned from URI.parse)
|
# A parsed URL (returned from URI.parse)
|
||||||
def handle_request(req, url)
|
def handle_request(req, url)
|
||||||
begin
|
begin
|
||||||
res = Net::HTTP.start(url.host, url.port) {|http|
|
# There is issue with ipv6 where address has to be in brackets, this causes the
|
||||||
|
# underlying ruby TCPSocket to fail. Net::HTTP.new will fail without brackets on
|
||||||
|
# joining the ipv6 address with :port or passing brackets to TCPSocket. It was
|
||||||
|
# found that if we use Net::HTTP.start with url.hostname the incriminated code
|
||||||
|
# won't be hit.
|
||||||
|
use_ssl = url.scheme == "https" ? true : false
|
||||||
|
res = Net::HTTP.start(url.hostname, url.port, {:use_ssl => use_ssl}) {|http|
|
||||||
http.request(req)
|
http.request(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user