summaryrefslogtreecommitdiff
path: root/src/mod_http_upload.erl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2017-03-27 23:52:49 +0200
committerHolger Weiss <holger@zedat.fu-berlin.de>2017-03-27 23:52:49 +0200
commit191fc1b4e87665df769ddac22335ac246b8d6f63 (patch)
treeaa704a8dbfbeb68ea968c712a2ea92e23c4824bb /src/mod_http_upload.erl
parentejabberd_http: Add "custom_headers" option (diff)
ejabberd_http: Expand @VERSION@ in custom headers
Let ejabberd_http expand the @VERSION@ keyword to the ejabberd version if specified in the "custom_headers" listener option. Closes #1414.
Diffstat (limited to 'src/mod_http_upload.erl')
-rw-r--r--src/mod_http_upload.erl10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl
index 59570b0b..31494c2e 100644
--- a/src/mod_http_upload.erl
+++ b/src/mod_http_upload.erl
@@ -500,16 +500,14 @@ get_proc_name(ServerHost, ModuleName) ->
-spec expand_home(binary()) -> binary().
-expand_home(Subject) ->
+expand_home(Input) ->
{ok, [[Home]]} = init:get_argument(home),
- Parts = binary:split(Subject, <<"@HOME@">>, [global]),
- str:join(Parts, list_to_binary(Home)).
+ jlib:expand_keyword(<<"@HOME@">>, Input, Home).
-spec expand_host(binary(), binary()) -> binary().
-expand_host(Subject, Host) ->
- Parts = binary:split(Subject, <<"@HOST@">>, [global]),
- str:join(Parts, Host).
+expand_host(Input, Host) ->
+ jlib:expand_keyword(<<"@HOST@">>, Input, Host).
%%--------------------------------------------------------------------
%% Internal functions.