diff options
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r-- | src/gun_http2.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 28b64eb..c48e07e 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -351,9 +351,13 @@ request(State0=#http2_state{socket=Socket, transport=Transport, encode_state=Enc State#http2_state{streams=[Stream|Streams], stream_id=StreamID + 2, encode_state=EncodeState}. prepare_headers(EncodeState, Transport, Method, Host0, Port, Path, Headers0) -> + Host2 = case Host0 of + Tuple when is_tuple(Tuple) -> inet:ntoa(Tuple); + _ -> Host0 + end, Authority = case lists:keyfind(<<"host">>, 1, Headers0) of {_, Host} -> Host; - _ -> [Host0, $:, integer_to_binary(Port)] + _ -> [Host2, $:, integer_to_binary(Port)] end, %% @todo We also must remove any header found in the connection header. Headers1 = |