From 7f4c74dec94f54c67c6392670f918ed672faf22e Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 17 Jul 2015 14:27:31 +0300 Subject: [PATCH] Print content types more gracefully --- src/mod_http_fileserver.erl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mod_http_fileserver.erl b/src/mod_http_fileserver.erl index 68ebf8835..8b4d7337e 100644 --- a/src/mod_http_fileserver.erl +++ b/src/mod_http_fileserver.erl @@ -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}.