diff options
author | Kim Alvefur <zash@zash.se> | 2015-09-27 00:37:18 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-09-27 00:37:18 +0200 |
commit | 3fc78cf2154d9a870763a06801bd167ddabf1c61 (patch) | |
tree | 2e6a296aac1eb2dbf8f40a56235d32870b270b99 /plugins/mod_http_files.lua | |
parent | a8ff283e3d24ebdd007050e37106ac786af2eaee (diff) | |
parent | 23fa3312e7d966a9205274189eb6b5d0d793c3be (diff) | |
download | prosody-3fc78cf2154d9a870763a06801bd167ddabf1c61.tar.gz prosody-3fc78cf2154d9a870763a06801bd167ddabf1c61.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_http_files.lua')
-rw-r--r-- | plugins/mod_http_files.lua | 4 |
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 |