aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http_files.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-26 19:34:58 +0200
committerKim Alvefur <zash@zash.se>2015-09-26 19:34:58 +0200
commita29f12e3090d7b6f9360150d51ea840989fca13d (patch)
tree58645f4be30cb5a3ee9eddd9a41ae1dcc935ee3d /plugins/mod_http_files.lua
parenta10c1e367fdd3fd641596b4276765c0286ca3ea0 (diff)
downloadprosody-a29f12e3090d7b6f9360150d51ea840989fca13d.tar.gz
prosody-a29f12e3090d7b6f9360150d51ea840989fca13d.zip
mod_http_files: Strip trailing directory separator regardless of directionality of the slash (fixes #545)
Diffstat (limited to 'plugins/mod_http_files.lua')
-rw-r--r--plugins/mod_http_files.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index 3a9368b9..9d81f540 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -62,7 +62,7 @@ function serve(opts)
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 attr = stat(full_path:match("^.*[^\\/]")); -- Strip trailing path separator because Windows
if not attr then
return 404;
end