]> granicus.if.org Git - ejabberd/commitdiff
Fix type of rest:url/2
authorChristophe Romain <christophe.romain@process-one.net>
Thu, 19 Apr 2018 11:21:33 +0000 (13:21 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Thu, 19 Apr 2018 11:21:33 +0000 (13:21 +0200)
src/rest.erl

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