25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Print content types more gracefully

This commit is contained in:
Evgeniy Khramtsov 2015-07-17 14:27:31 +03:00
parent 44cc99d616
commit 7f4c74dec9

View File

@ -167,10 +167,17 @@ initialize(Host, Opts) ->
?DEFAULT_CONTENT_TYPE),
ContentTypes = build_list_content_types(
gen_mod:get_opt(content_types, Opts,
fun(L) when is_list(L) -> L end,
[]),
fun(L) when is_list(L) ->
lists:map(
fun({K, V}) ->
{iolist_to_binary(K),
iolist_to_binary(V)}
end, L)
end, []),
?DEFAULT_CONTENT_TYPES),
?INFO_MSG("initialize: ~n ~p", [ContentTypes]),%+++
?INFO_MSG("known content types: ~s",
[str:join([[$*, K, " -> ", V] || {K, V} <- ContentTypes],
<<", ">>)]),
{DocRoot, AccessLog, AccessLogFD, DirectoryIndices,
CustomHeaders, DefaultContentType, ContentTypes}.