projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53a00f3
)
mod_http_files: Strip trailing directory separator regardless of directionality of...
author
Kim Alvefur
<zash@zash.se>
Sat, 26 Sep 2015 17:34:58 +0000
(19:34 +0200)
committer
Kim Alvefur
<zash@zash.se>
Sat, 26 Sep 2015 17:34:58 +0000
(19:34 +0200)
plugins/mod_http_files.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_http_files.lua
b/plugins/mod_http_files.lua
index 3a9368b9a65160a5b44c98c9be4fd25f77040905..9d81f5405b5a01a9cfd96b4b3859b23808eca1d2 100644
(file)
--- 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