From 97de58310756a68f1e126feb56ebd7d2dd39bf36 Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 6 Sep 2018 12:59:43 +0200 Subject: [PATCH] Check ejabberd_auth_http options names and values --- ejabberd_auth_http/src/ejabberd_auth_http.erl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ejabberd_auth_http/src/ejabberd_auth_http.erl b/ejabberd_auth_http/src/ejabberd_auth_http.erl index 8bd213d..2e657d8 100644 --- a/ejabberd_auth_http/src/ejabberd_auth_http.erl +++ b/ejabberd_auth_http/src/ejabberd_auth_http.erl @@ -37,7 +37,21 @@ %%% API %%%---------------------------------------------------------------------- -opt_type(auth_opts) -> fun (V) -> V end; +opt_type(auth_opts) -> + fun(L) -> + lists:map( + fun({host, V}) when is_binary(V) -> + {host, V}; + ({connection_pool_size, V}) when is_integer(V) -> + {connection_pool_size, V}; + ({connection_opts, V}) when is_list(V) -> + {connection_opts, V}; + ({basic_auth, V}) when is_binary(V) -> + {basic_auth, V}; + ({path_prefix, V}) when is_binary(V) -> + {path_prefix, V} + end, L) + end; opt_type(_) -> [auth_opts]. -spec start(binary()) -> ok.