From 236f36848bcb7f03312992779d02df33667cbce9 Mon Sep 17 00:00:00 2001 From: omarkj Date: Mon, 11 Aug 2014 17:43:08 -0700 Subject: [PATCH] Don't overwrite the `Host` header passed in by the user. --- src/hackney_client/hackney.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hackney_client/hackney.erl b/src/hackney_client/hackney.erl index 4ea24fa7..089127ce 100644 --- a/src/hackney_client/hackney.erl +++ b/src/hackney_client/hackney.erl @@ -541,8 +541,7 @@ stop_async(Ref) -> host_header(#hackney_url{netloc=Netloc}, Headers) -> case proplists:get_value(<<"Host">>, Headers) of undefined -> Headers ++ [{<<"Host">>, Netloc}]; - _ -> lists:keyreplace(<<"Host">>, 1, Headers, - {<<"Host">>, Netloc}) + _ -> Headers end. make_request(connect, #hackney_url{}=URL, Headers, Body, _, _) ->