diff options
author | Loïc Hoguin <[email protected]> | 2018-09-26 12:08:11 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-09-26 12:08:11 +0200 |
commit | f328916937c67b3c9679e4f11d4594c39d36f85d (patch) | |
tree | 53c8c3df47443227fc2800ffe450c94ab7e58478 /src/gun_http.erl | |
parent | baf0e420917ca1cb2806f8594a6cdb4710d2793d (diff) | |
download | gun-f328916937c67b3c9679e4f11d4594c39d36f85d.tar.gz gun-f328916937c67b3c9679e4f11d4594c39d36f85d.tar.bz2 gun-f328916937c67b3c9679e4f11d4594c39d36f85d.zip |
Keep track of the intermediaries the connection go through
Also augment the CONNECT tests to confirm that the
intermediaries are accounted for.
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index c2b0ed6..c4291bc 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -229,13 +229,13 @@ handle_head(Data, State=#http_state{socket=Socket, version=ClientVersion, {ok, TLSSocket} -> case ssl:negotiated_protocol(TLSSocket) of {ok, <<"h2">>} -> - [{switch_transport, gun_tls, TLSSocket}, - {switch_protocol, gun_http2, State2}, - {origin, <<"https">>, NewHost, NewPort}]; + [{origin, <<"https">>, NewHost, NewPort, connect}, + {switch_transport, gun_tls, TLSSocket}, + {switch_protocol, gun_http2, State2}]; _ -> [{state, State2#http_state{socket=TLSSocket, transport=gun_tls}}, - {switch_transport, gun_tls, TLSSocket}, - {origin, <<"https">>, NewHost, NewPort}] + {origin, <<"https">>, NewHost, NewPort, connect}, + {switch_transport, gun_tls, TLSSocket}] end; Error -> Error @@ -244,10 +244,10 @@ handle_head(Data, State=#http_state{socket=Socket, version=ClientVersion, case maps:get(protocols, Destination, [http]) of [http] -> [{state, State2}, - {origin, <<"http">>, NewHost, NewPort}]; + {origin, <<"http">>, NewHost, NewPort, connect}]; [http2] -> - [{switch_protocol, gun_http2, State2}, - {origin, <<"http">>, NewHost, NewPort}] + [{origin, <<"http">>, NewHost, NewPort, connect}, + {switch_protocol, gun_http2, State2}] end end; {_, _} when Status >= 100, Status =< 199 -> |