summaryrefslogtreecommitdiff
path: root/src/mod_http_fileserver.erl
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2015-07-17 14:27:31 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2015-07-17 14:29:11 +0300
commit7f4c74dec94f54c67c6392670f918ed672faf22e (patch)
treed1691eec3c390e7af8566c1057deb0f1d200eed1 /src/mod_http_fileserver.erl
parentGet rid of 'db_type' for mod_blocking in test suite (diff)
Print content types more gracefully
Diffstat (limited to 'src/mod_http_fileserver.erl')
-rw-r--r--src/mod_http_fileserver.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mod_http_fileserver.erl b/src/mod_http_fileserver.erl
index 68ebf883..8b4d7337 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}.