Created
February 12, 2024 15:30
-
-
Save RaitoBezarius/8b1b8ba60b51d161948f33933377d734 to your computer and use it in GitHub Desktop.
Support /etc/hosts in Mastodon patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/lib/request.rb b/app/lib/request.rb | |
index 8d4120868..e640fadd2 100644 | |
--- a/app/lib/request.rb | |
+++ b/app/lib/request.rb | |
@@ -261,11 +261,7 @@ class Request | |
begin | |
addresses = [IPAddr.new(host)] | |
rescue IPAddr::InvalidAddressError | |
- Resolv::DNS.open do |dns| | |
- 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 | |
+ addresses = Resolv::getaddresses(host) | |
end | |
socks = [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment