diff options
author | Kim Alvefur <zash@zash.se> | 2015-09-26 19:34:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-09-26 19:34:58 +0200 |
commit | 38b909e686f7ec77ec31fe7c0efe04e118a523a7 (patch) | |
tree | 58645f4be30cb5a3ee9eddd9a41ae1dcc935ee3d /plugins | |
parent | 7a845c8961fa0495376bfbacee9b44210b3e7928 (diff) | |
download | prosody-38b909e686f7ec77ec31fe7c0efe04e118a523a7.tar.gz prosody-38b909e686f7ec77ec31fe7c0efe04e118a523a7.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.lua | 2 |
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 |