Convert password provided by web form to UTF8 before passing it (#375)

This commit is contained in:
Badlop 2016-07-22 16:51:48 +02:00
parent ffbe97d988
commit c5d9d35e7b
1 changed files with 2 additions and 1 deletions

View File

@ -763,7 +763,8 @@ parse_auth(<<"Basic ", Auth64/binary>>) ->
undefined;
Pos ->
{User, <<$:, Pass/binary>>} = erlang:split_binary(Auth, Pos-1),
{User, Pass}
PassUtf8 = unicode:characters_to_binary(binary_to_list(Pass), utf8),
{User, PassUtf8}
end;
parse_auth(<<"Bearer ", SToken/binary>>) ->
Token = str:strip(SToken),