1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 17:59:31 +02:00

Fix type of rest:url/2

This commit is contained in:
Christophe Romain 2018-04-19 13:21:33 +02:00
parent a567abcfdf
commit 42c029d5f7

View file

@ -174,13 +174,13 @@ base_url(Server, Path) ->
end. end.
url(Url, []) -> url(Url, []) ->
Url; binary_to_list(Url);
url(Url, Params) -> url(Url, Params) ->
L = [<<"&", (iolist_to_binary(Key))/binary, "=", L = [<<"&", (iolist_to_binary(Key))/binary, "=",
(misc:url_encode(Value))/binary>> (misc:url_encode(Value))/binary>>
|| {Key, Value} <- Params], || {Key, Value} <- Params],
<<$&, Encoded/binary>> = iolist_to_binary(L), <<$&, Encoded/binary>> = iolist_to_binary(L),
<<Url/binary, $?, Encoded/binary>>. binary_to_list(<<Url/binary, $?, Encoded/binary>>).
url(Server, Path, Params) -> url(Server, Path, Params) ->
case binary:split(base_url(Server, Path), <<"?">>) of case binary:split(base_url(Server, Path), <<"?">>) of
[Url] -> [Url] ->