th: add support for /etc/hosts
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
Helped-by: Tim Perry <1526883+pimterry@users.noreply.github.com> Helped-by: Jonathan de Jong <jo@jo.wtf> Committed-by: kouhai <kouhai@treehouse.systems> Fixes: https://github.com/mastodon/mastodon/issues/9436main-rebase
parent
6face4d0ee
commit
086da716d3
|
@ -261,11 +261,7 @@ class Request
|
||||||
begin
|
begin
|
||||||
addresses = [IPAddr.new(host)]
|
addresses = [IPAddr.new(host)]
|
||||||
rescue IPAddr::InvalidAddressError
|
rescue IPAddr::InvalidAddressError
|
||||||
Resolv::DNS.open do |dns|
|
addresses = Resolv::getaddresses(host)
|
||||||
dns.timeouts = 5
|
|
||||||
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
|
end
|
||||||
|
|
||||||
socks = []
|
socks = []
|
||||||
|
|
Loading…
Reference in New Issue