diff options
author | gabrielgatu <gabriel.dny@gmail.com> | 2016-09-08 11:34:42 +0200 |
---|---|---|
committer | Mickael Remond <mremond@process-one.net> | 2016-09-08 11:37:14 +0200 |
commit | 803270fc6b8ed3ba718f7e231b149caef70aa1ae (patch) | |
tree | cc4508758cbcec7a74568834888f3208d876a953 /src/ejabberd_http.erl | |
parent | Support for publishing to hex.pm with latest Elixir mix (diff) |
Support for Elixir configuration file #1208
Contribution for Google Summer of code 2016 by Gabriel Gatu
Diffstat (limited to 'src/ejabberd_http.erl')
-rw-r--r-- | src/ejabberd_http.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index a79f2630..31f80be7 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -145,9 +145,14 @@ init({SockMod, Socket}, Opts) -> DefinedHandlers = gen_mod:get_opt( request_handlers, Opts, fun(Hs) -> + Hs1 = lists:map(fun + ({Mod, Path}) when is_atom(Mod) -> {Path, Mod}; + ({Path, Mod}) -> {Path, Mod} + end, Hs), + [{str:tokens( iolist_to_binary(Path), <<"/">>), - Mod} || {Path, Mod} <- Hs] + Mod} || {Path, Mod} <- Hs1] end, []), RequestHandlers = DefinedHandlers ++ Captcha ++ Register ++ Admin ++ Bind ++ XMLRPC, |