Skip to content
Snippets Groups Projects
Unverified Commit c989faaa authored by Claire's avatar Claire Committed by GitHub
Browse files

Change Request connection logic to try both IPv6 and IPv4 when available (#20108)

Fixes #19751
parent 36b0ff57
No related branches found
No related tags found
No related merge requests found
......@@ -199,7 +199,8 @@ class Request
rescue IPAddr::InvalidAddressError
Resolv::DNS.open do |dns|
dns.timeouts = 5
addresses = dns.getaddresses(host).take(2)
addresses = dns.getaddresses(host)
addresses = addresses.filter { |addr| addr.is_a?(Resolv::IPv6) }.take(2) + addresses.filter { |addr| !addr.is_a?(Resolv::IPv6) }.take(2)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment