diff options
author | Loïc Hoguin <[email protected]> | 2020-03-25 11:22:59 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-03-25 11:22:59 +0100 |
commit | 2eaf28d3876c1ebcbf31d843e77f809e0c25aefb (patch) | |
tree | 1e93f66be05bc60bf27e5e5f30d31f44cfdac3eb /test/gun_test.erl | |
parent | 3deadc01ee34e27cfba49b78debcf8006d7d7e1c (diff) | |
download | gun-2eaf28d3876c1ebcbf31d843e77f809e0c25aefb.tar.gz gun-2eaf28d3876c1ebcbf31d843e77f809e0c25aefb.tar.bz2 gun-2eaf28d3876c1ebcbf31d843e77f809e0c25aefb.zip |
Fix host/:authority header when connecting to an IPv6 address
Diffstat (limited to 'test/gun_test.erl')
-rw-r--r-- | test/gun_test.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/gun_test.erl b/test/gun_test.erl index bb162f4..c6cdd8c 100644 --- a/test/gun_test.erl +++ b/test/gun_test.erl @@ -45,7 +45,8 @@ init_origin(Transport, Protocol, Fun) -> {ok, Pid, Port}. init_origin(Parent, tcp, Protocol, Fun) -> - {ok, ListenSocket} = gen_tcp:listen(0, [binary, {active, false}]), + %% We setup the socket for both IPv4 and IPv6. + {ok, ListenSocket} = gen_tcp:listen(0, [binary, {active, false}, inet6]), {ok, {_, Port}} = inet:sockname(ListenSocket), Parent ! {self(), Port}, {ok, ClientSocket} = gen_tcp:accept(ListenSocket, 5000), |