Skip to content

Commit

Permalink
fix idna encoding for local unix socket
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Sep 28, 2018
1 parent f18e3aa commit a168a3d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/hackney_connect.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ connect(Transport, Host, Port, Options, Dynamic) ->
{host, Host},
{port, Port},
{dynamic, Dynamic}]),
case create_connection(Transport, idna:utf8_to_ascii(Host), Port,
Options, Dynamic) of

Host2 = case Transport of
hackney_local_tcp -> Host;
_ -> idna:utf8_to_ascii(Host)
end,

case create_connection(Transport, Host2, Port, Options, Dynamic) of
{ok, #client{request_ref=Ref}} ->
{ok, Ref};
Error ->
Expand Down

0 comments on commit a168a3d

Please sign in to comment.