Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hackney_happy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ getbyname(Hostname, Type) ->
%% First try DNS resolution using inet_res:getbyname
case (catch inet_res:getbyname(Hostname, Type)) of
{'ok', #hostent{h_addr_list=AddrList}} ->
lists:usort(AddrList);
AddrList;
{error, _Reason} ->
%% DNS failed, try fallback to /etc/hosts using inet:gethostbyname
%% This fixes NXDOMAIN errors in Docker Compose environments where
Expand All @@ -150,7 +150,7 @@ fallback_hosts_lookup(Hostname, Type) ->
end,
case (catch inet:gethostbyname(Hostname, InetType)) of
{'ok', #hostent{h_addr_list=AddrList}} ->
lists:usort(AddrList);
AddrList;
_ ->
[]
end.
Expand Down