Skip to content

Commit

Permalink
convert User/Pwd as string if needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Nov 27, 2014
1 parent 52353be commit 122d1ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hackney_client/hackney_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ perform(Client0, {Method0, Path, Headers0, Body0}) ->
undefined ->
DefaultHeaders0;
{User, Pwd} ->
Credentials = base64:encode(<< User/binary, ":", Pwd/binary >>),
User1 = hackney_bstr:to_binary(User),
Pwd1 = hackney_bstr:to_binary(Pwd),
Credentials = base64:encode(<< User1/binary, ":", Pwd1/binary >>),
DefaultHeaders0 ++ [{<<"Authorization">>,
<<"Basic ", Credentials/binary>>}]
end,
Expand Down

0 comments on commit 122d1ee

Please sign in to comment.