aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_files.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-27 00:36:34 +0200
committerKim Alvefur <zash@zash.se>2015-09-27 00:36:34 +0200
commitb9c17069eac26443575ceee3674a12cb41df4f52 (patch)
treea060ff32f39e4a6fbce69a8c25da3d7f1e45900d /plugins/mod_http_files.lua
parent01328b14950ee60ea8a3b77f4e7899824da0fbe4 (diff)
parentb7b28af321e349cac16f2a9709fe9d618d5d8bf0 (diff)
downloadprosody-b9c17069eac26443575ceee3674a12cb41df4f52.tar.gz
prosody-b9c17069eac26443575ceee3674a12cb41df4f52.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_http_files.lua')
-rw-r--r--plugins/mod_http_files.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index 2e9f4182..7c503c82 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -61,8 +61,8 @@ function serve(opts)
local function serve_file(event, path)
local request, response = event.request, event.response;
local orig_path = request.path;
- local full_path = base_path .. (path and "/"..path or "");
- local attr = stat((full_path:gsub('%'..path_sep..'+$','')));
+ local full_path = base_path .. (path and "/"..path or ""):gsub("/", path_sep);
+ local attr = stat(full_path:match("^.*[^\\/]")); -- Strip trailing path separator because Windows
if not attr then
return 404;
end