From 89e0a70e44891e620c1db5157f6d3c653c8e91e6 Mon Sep 17 00:00:00 2001 From: Badlop Date: Mon, 25 May 2015 11:59:11 +0200 Subject: [PATCH] ejabberd_auth_http bad argument in call to lists:keyfind (#104) --- ejabberd_auth_http/src/ejabberd_auth_http.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ejabberd_auth_http/src/ejabberd_auth_http.erl b/ejabberd_auth_http/src/ejabberd_auth_http.erl index 646122b..83e979e 100644 --- a/ejabberd_auth_http/src/ejabberd_auth_http.erl +++ b/ejabberd_auth_http/src/ejabberd_auth_http.erl @@ -37,7 +37,8 @@ -spec start(binary()) -> ok. start(Host) -> - AuthOpts = ejabberd_config:get_local_option(auth_opts, Host), + AuthOpts = ejabberd_config:get_local_option(auth_opts, fun(A) when is_list(A) -> A end, + <<"localhost">>), {_, AuthHost} = lists:keyfind(host, 1, AuthOpts), PoolSize = proplists:get_value(connection_pool_size, AuthOpts, 10), Opts = proplists:get_value(connection_opts, AuthOpts, []), @@ -223,7 +224,8 @@ remove_user_req(LUser, LServer, Password, Method) -> make_req(_, _, LUser, LServer, _) when LUser == error orelse LServer == error -> {error, {prep_failed, LUser, LServer}}; make_req(Method, Path, LUser, LServer, Password) -> - AuthOpts = ejabberd_config:get_local_option(auth_opts, LServer), + AuthOpts = ejabberd_config:get_local_option(auth_opts, fun(A) when is_list(A) -> A end, + <<"localhost">>), BasicAuth = case lists:keyfind(basic_auth, 1, AuthOpts) of {_, BasicAuth0} -> BasicAuth0; _ -> ""