mod_http_files: Preserve a trailing / in paths (fixes #639)
authorKim Alvefur <zash@zash.se>
Thu, 3 Mar 2016 14:31:46 +0000 (15:31 +0100)
committerKim Alvefur <zash@zash.se>
Thu, 3 Mar 2016 14:31:46 +0000 (15:31 +0100)
plugins/mod_http_files.lua

index fc39628ccba073f97ff6ea615811609708c6e980..53b6469bb0e2f7b3a4c01a0d4c8003aed3fbd9a3 100644 (file)
@@ -75,6 +75,9 @@ function sanitize_path(path)
                        out[c] = component;
                end
        end
+       if path:sub(-1,-1) == "/" then
+               out[c+1] = "";
+       end
        return "/"..table.concat(out, "/");
 end