diff options
author | Loïc Hoguin <[email protected]> | 2019-09-19 15:14:31 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-09-22 16:46:35 +0200 |
commit | 02dd576a837b8b47b1c656c6f4b8769c1aeb4ed0 (patch) | |
tree | b405a4fc250ce60c7ee2fdba5e29858c54df8c4a /test/rfc7231_SUITE.erl | |
parent | 617554f305dc3bd031779ba0b8ef8d52edb52edd (diff) | |
download | gun-02dd576a837b8b47b1c656c6f4b8769c1aeb4ed0.tar.gz gun-02dd576a837b8b47b1c656c6f4b8769c1aeb4ed0.tar.bz2 gun-02dd576a837b8b47b1c656c6f4b8769c1aeb4ed0.zip |
Add Socks5->HTTP/2 tests
Also consolidate the ALPN code in the tls_handshake state
rather than doing it in CONNECT/Socks separately.
Also improves the origin tests by sending a message once
the handshake is completed instead of having timeouts.
Diffstat (limited to 'test/rfc7231_SUITE.erl')
-rw-r--r-- | test/rfc7231_SUITE.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/rfc7231_SUITE.erl b/test/rfc7231_SUITE.erl index e5df4ef..ec63cbe 100644 --- a/test/rfc7231_SUITE.erl +++ b/test/rfc7231_SUITE.erl @@ -168,6 +168,7 @@ do_connect_http(OriginScheme, OriginTransport, ProxyTransport) -> }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), {response, fin, 200, _} = gun:await(ConnPid, StreamRef), + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), Data = receive_from(OriginPid), Lines = binary:split(Data, <<"\r\n">>, [global]), @@ -221,7 +222,7 @@ do_connect_h2(OriginScheme, OriginTransport, ProxyTransport) -> }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), {response, fin, 200, _} = gun:await(ConnPid, StreamRef), - timer:sleep(1000), %% Give enough time for the ssl/h2 handshakes to fully complete. + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), <<_:24, 1:8, _/bits>> = receive_from(OriginPid), #{ @@ -262,6 +263,7 @@ connect_through_multiple_proxies(_) -> }), {request, <<"CONNECT">>, Authority2, 'HTTP/1.1', _} = receive_from(Proxy2Pid), {response, fin, 200, _} = gun:await(ConnPid, StreamRef2), + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), Data = receive_from(OriginPid), Lines = binary:split(Data, <<"\r\n">>, [global]), @@ -301,6 +303,7 @@ connect_delay(_) -> }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid, 3000), {response, fin, 201, _} = gun:await(ConnPid, StreamRef), + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), Data = receive_from(OriginPid), Lines = binary:split(Data, <<"\r\n">>, [global]), @@ -334,6 +337,7 @@ connect_response_201(_) -> }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), {response, fin, 201, _} = gun:await(ConnPid, StreamRef), + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), Data = receive_from(OriginPid), Lines = binary:split(Data, <<"\r\n">>, [global]), @@ -474,6 +478,7 @@ connect_response_ignore_transfer_encoding(_) -> }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), {response, fin, 200, Headers} = gun:await(ConnPid, StreamRef), + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), Data = receive_from(OriginPid), Lines = binary:split(Data, <<"\r\n">>, [global]), @@ -495,6 +500,7 @@ connect_response_ignore_content_length(_) -> }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), {response, fin, 200, Headers} = gun:await(ConnPid, StreamRef), + handshake_completed = receive_from(OriginPid), _ = gun:get(ConnPid, "/proxied"), Data = receive_from(OriginPid), Lines = binary:split(Data, <<"\r\n">>, [global]), |