Comparison

plugins/mod_http_files.lua @ 7230:20246b139607

mod_http_files: Preserve a trailing / in paths (fixes #639)
author Kim Alvefur <zash@zash.se>
date Thu, 03 Mar 2016 15:31:46 +0100
parent 7229:dcc8ed11173c
child 7231:c018a44b822a
comparison
equal deleted inserted replaced
7229:dcc8ed11173c 7230:20246b139607
72 c = c - 1; 72 c = c - 1;
73 elseif component ~= "." then 73 elseif component ~= "." then
74 c = c + 1; 74 c = c + 1;
75 out[c] = component; 75 out[c] = component;
76 end 76 end
77 end
78 if path:sub(-1,-1) == "/" then
79 out[c+1] = "";
77 end 80 end
78 return "/"..table.concat(out, "/"); 81 return "/"..table.concat(out, "/");
79 end 82 end
80 83
81 local cache = setmetatable({}, { __mode = "kv" }); -- Let the garbage collector have it if it wants to. 84 local cache = setmetatable({}, { __mode = "kv" }); -- Let the garbage collector have it if it wants to.