summaryrefslogtreecommitdiff
path: root/src/mod_http_upload.erl
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2016-02-20 18:21:38 +0100
committerHolger Weiss <holger@zedat.fu-berlin.de>2016-02-20 18:21:38 +0100
commitb971449f1267a3844bd3fe8aa6c4d22fbbaed0c0 (patch)
tree312312c7399ef9c887623e602b78a3e8cb1fec4c /src/mod_http_upload.erl
parentMerge pull request #961 from weiss/compression-after-sasl (diff)
mod_http_upload: Expand 'docroot' before using it
Expand the @HOME@ keyword within the 'docroot' value before setting the permissions of the document root directory.
Diffstat (limited to 'src/mod_http_upload.erl')
-rw-r--r--src/mod_http_upload.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl
index 5d21b497..24cf8aaf 100644
--- a/src/mod_http_upload.erl
+++ b/src/mod_http_upload.erl
@@ -273,6 +273,7 @@ init({ServerHost, Opts}) ->
Thumbnail = gen_mod:get_opt(thumbnail, Opts,
fun(B) when is_boolean(B) -> B end,
true),
+ DocRoot1 = expand_home(str:strip(DocRoot, right, $/)),
case ServiceURL of
undefined ->
ok;
@@ -289,7 +290,7 @@ init({ServerHost, Opts}) ->
undefined ->
ok;
Mode ->
- file:change_mode(DocRoot, Mode)
+ file:change_mode(DocRoot1, Mode)
end,
case Thumbnail of
true ->
@@ -309,7 +310,7 @@ init({ServerHost, Opts}) ->
secret_length = SecretLength, jid_in_url = JIDinURL,
file_mode = FileMode, dir_mode = DirMode,
thumbnail = Thumbnail,
- docroot = expand_home(str:strip(DocRoot, right, $/)),
+ docroot = DocRoot1,
put_url = expand_host(str:strip(PutURL, right, $/), ServerHost),
get_url = expand_host(str:strip(GetURL, right, $/), ServerHost),
service_url = ServiceURL}}.