From 21d78a74c1a71d3523ce7129adc16646efe9ef4e Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 28 Apr 2020 11:31:42 +0200 Subject: [PATCH] Update mod_post_log parsing url option, so it starts with recent ejabberd --- mod_post_log/src/mod_post_log.erl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mod_post_log/src/mod_post_log.erl b/mod_post_log/src/mod_post_log.erl index 66af7a8..55cb36b 100644 --- a/mod_post_log/src/mod_post_log.erl +++ b/mod_post_log/src/mod_post_log.erl @@ -42,7 +42,10 @@ stop(Host) -> depends(_Host, _Opts) -> []. -mod_opt_type(url) -> fun binary_to_list/1; +mod_opt_type(url) -> + fun(Val) when is_binary(Val) -> binary_to_list(Val); + (Val) -> Val + end; mod_opt_type(ts_header) -> fun binary_to_list/1; mod_opt_type(from_header) -> fun binary_to_list/1; mod_opt_type(to_header) -> fun binary_to_list/1; @@ -53,11 +56,11 @@ mod_opt_type(req_options) -> fun(L) when is_list(L) -> L end. mod_options(_Host) -> [{url, undefined}, - {ts_header, "X-Message-Timestamp"}, - {from_header, "X-Message-From"}, - {to_header, "X-Message-To"}, + {ts_header, <<"X-Message-Timestamp">>}, + {from_header, <<"X-Message-From">>}, + {to_header, <<"X-Message-To">>}, {headers, []}, - {content_type, "text/xml"}, + {content_type, <<"text/xml">>}, {http_options, []}, {req_options, []}].