From ce20f975b471a8b3769fa935e588233849afc5b2 Mon Sep 17 00:00:00 2001 From: Fabian Muscariello Date: Tue, 13 Jun 2017 23:35:34 +0200 Subject: [PATCH] Add address family for inet:gethostbyname/2 call The previously used inet:gethostbyname/1 would use IPv6 only if inet_db:res_option(inet6) returned true, but the default resolver setting for inet6 is false. --- src/ibrowse_http_client.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl index 867117c..07253fc 100644 --- a/src/ibrowse_http_client.erl +++ b/src/ibrowse_http_client.erl @@ -619,7 +619,7 @@ is_ipv6_host(Host) -> {ok, {_, _, _, _}} -> false; _ -> - case inet:gethostbyname(Host) of + case inet:gethostbyname(Host, inet6) of {ok, #hostent{h_addrtype = inet6}} -> true; _ ->