aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commitc6d0454e0f3c4b47ae37903727d8bec8926cacae (patch)
tree58645f4be30cb5a3ee9eddd9a41ae1dcc935ee3d /plugins
parent971ea4fc066fce783b3c26655e39bc2a72ac0992 (diff)
downloadprosody-c6d0454e0f3c4b47ae37903727d8bec8926cacae.tar.gz
prosody-c6d0454e0f3c4b47ae37903727d8bec8926cacae.zip
mod_http_files: Strip trailing directory separator regardless of directionality of the slash (fixes #545)
Diffstat (limited to 'plugins')
-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