aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http2.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-01-02 15:08:45 +0100
committerLoïc Hoguin <[email protected]>2019-01-02 15:08:45 +0100
commit8a30f96cf19f9104e3ae8df5f85df33b66b5bfc2 (patch)
treed3e88a75756d45ab41bbf78ab8cb909107a55c2e /src/gun_http2.erl
parentca0db57a30c4978f0291ef7900962ed9b8de005d (diff)
downloadgun-8a30f96cf19f9104e3ae8df5f85df33b66b5bfc2.tar.gz
gun-8a30f96cf19f9104e3ae8df5f85df33b66b5bfc2.tar.bz2
gun-8a30f96cf19f9104e3ae8df5f85df33b66b5bfc2.zip
Don't send the default port in the host header for HTTP/2
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r--src/gun_http2.erl7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl
index f5cf834..3d02fcf 100644
--- a/src/gun_http2.erl
+++ b/src/gun_http2.erl
@@ -268,14 +268,9 @@ request(State=#http2_state{socket=Socket, transport=Transport,
streams=[Stream|Streams]}, StreamID, fin, Body).
prepare_headers(#http2_state{transport=Transport}, Method, Host0, Port, Path, Headers0) ->
- Host1 = case Host0 of
- {local, _SocketPath} -> <<>>;
- Tuple when is_tuple(Tuple) -> inet:ntoa(Tuple);
- _ -> Host0
- end,
Authority = case lists:keyfind(<<"host">>, 1, Headers0) of
{_, Host} -> Host;
- _ -> [Host1, $:, integer_to_binary(Port)]
+ _ -> gun_http:host_header(Transport, Host0, Port)
end,
%% @todo We also must remove any header found in the connection header.
Headers =