Diff

plugins/mod_http_files.lua @ 5261:b14f02671439

mod_http_files: Rename config options and variable names
author Kim Alvefur <zash@zash.se>
date Fri, 21 Dec 2012 17:22:19 +0100
parent 5260:87f72452a893
child 5262:4e58fde55594
line wrap: on
line diff
--- a/plugins/mod_http_files.lua	Fri Dec 21 16:10:45 2012 +0100
+++ b/plugins/mod_http_files.lua	Fri Dec 21 17:22:19 2012 +0100
@@ -14,9 +14,9 @@
 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 @@
 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 @@
 			end
 		end
 
-		if not show_file_list then
+		if not directory_index then
 			return 403;
 		else
 			local html = require"util.stanza".stanza("html")