fix(authn): fix bugs in http and pgsql authn
This commit is contained in:
parent
e31840d943
commit
11bdfcb8f0
|
@ -188,8 +188,8 @@ check_url(URL) ->
|
|||
end.
|
||||
|
||||
check_body(Body) ->
|
||||
lists:any(fun({_, V}) ->
|
||||
not is_binary(V)
|
||||
lists:all(fun({_, V}) ->
|
||||
is_binary(V)
|
||||
end, maps:to_list(Body)).
|
||||
|
||||
default_headers() ->
|
||||
|
|
|
@ -150,7 +150,7 @@ check_password(Password,
|
|||
parse_query(Query) ->
|
||||
case re:run(Query, ?RE_PLACEHOLDER, [global, {capture, all, binary}]) of
|
||||
{match, Captured} ->
|
||||
PlaceHolders = [PlaceHolder || PlaceHolder <- Captured],
|
||||
PlaceHolders = [PlaceHolder || [PlaceHolder] <- Captured],
|
||||
Replacements = ["$" ++ integer_to_list(I) || I <- lists:seq(1, length(Captured))],
|
||||
NQuery = lists:foldl(fun({PlaceHolder, Replacement}, Query0) ->
|
||||
re:replace(Query0, <<"'\\", PlaceHolder/binary, "'">>, Replacement, [{return, binary}])
|
||||
|
|
Loading…
Reference in New Issue