mod_http_files: Don't prepend / to path twice, sanitize path does this already
authorKim Alvefur <zash@zash.se>
Thu, 3 Mar 2016 14:30:00 +0000 (15:30 +0100)
committerKim Alvefur <zash@zash.se>
Thu, 3 Mar 2016 14:30:00 +0000 (15:30 +0100)
plugins/mod_http_files.lua

index 097f83468b41725e218794664d27970d2919cb7d..fc39628ccba073f97ff6ea615811609708c6e980 100644 (file)
@@ -95,7 +95,7 @@ function serve(opts)
                end
                path = sanitized_path;
                local orig_path = sanitize_path(request.path);
-               local full_path = base_path .. (path and "/"..path or ""):gsub("/", path_sep);
+               local full_path = base_path .. (path or ""):gsub("/", path_sep);
                local attr = stat(full_path:match("^.*[^\\/]")); -- Strip trailing path separator because Windows
                if not attr then
                        return 404;