From 8bf32f0b1cbba88e6bb97b8a7e47b207e864882a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Dec 2012 17:22:19 +0100 Subject: mod_http_files: Rename config options and variable names --- plugins/mod_http_files.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/mod_http_files.lua') diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua index 2e906b70..d77c64c0 100644 --- a/plugins/mod_http_files.lua +++ b/plugins/mod_http_files.lua @@ -14,9 +14,9 @@ local open = io.open; local stat = lfs.attributes; local build_path = require"socket.url".build_path; -local http_base = module:get_option_string("http_files_dir", module:get_option_string("http_path", "www_files")); -local dir_indices = module:get_option("http_files_index", { "index.html", "index.htm" }); -local show_file_list = module:get_option_boolean("http_files_show_list"); +local base_path = module:get_option_string("http_files_dir", module:get_option_string("http_path", "www_files")); +local dir_indices = module:get_option("http_index_files", { "index.html", "index.htm" }); +local directory_index = module:get_option_boolean("http_dir_listing"); local mime_map = module:shared("mime").types; if not mime_map then @@ -52,7 +52,7 @@ local cache = setmetatable({}, { __mode = "kv" }); -- Let the garbage collector function serve_file(event, path) local request, response = event.request, event.response; local orig_path = request.path; - local full_path = http_base.."/"..path; + local full_path = base_path.."/"..path; local attr = stat(full_path); if not attr then return 404; @@ -90,7 +90,7 @@ function serve_file(event, path) end end - if not show_file_list then + if not directory_index then return 403; else local html = require"util.stanza".stanza("html") -- cgit v1.2.3