aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-11-12 14:45:07 +0100
committerLoïc Hoguin <[email protected]>2020-11-12 14:45:07 +0100
commit093dcd5fdefb6df0d316624665c584f37040cdd8 (patch)
tree658da968ae9a808ebd44740d721143c59aeec348 /src
parent30a971a039c2725726080ce6d50ce90e1108cb5a (diff)
downloadgun-093dcd5fdefb6df0d316624665c584f37040cdd8.tar.gz
gun-093dcd5fdefb6df0d316624665c584f37040cdd8.tar.bz2
gun-093dcd5fdefb6df0d316624665c584f37040cdd8.zip
Fix a low hanging fruit todo
Diffstat (limited to 'src')
-rw-r--r--src/gun_http.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl
index 9c52f2d..cc541e2 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -605,11 +605,12 @@ send_request(State=#http_state{socket=Socket, transport=Transport, version=Versi
undefined -> request_io_from_headers(Headers2);
_ -> head
end,
- %% @todo Move this inside the case clause.
- Authority0 = host_header(Transport, Host, Port),
{Authority, Headers3} = case lists:keyfind(<<"host">>, 1, Headers2) of
- false -> {Authority0, [{<<"host">>, Authority0}|Headers2]};
- {_, Authority1} -> {Authority1, Headers2}
+ false ->
+ Authority0 = host_header(Transport, Host, Port),
+ {Authority0, [{<<"host">>, Authority0}|Headers2]};
+ {_, Authority1} ->
+ {Authority1, Headers2}
end,
Headers4 = transform_header_names(State, Headers3),
Headers5 = case {Body, Out} of