local http_base = config.get("*", "core", "http_path") or "www_files";
local response_400 = { status = "400 Bad Request", body = "<h1>Bad Request</h1>Sorry, we didn't understand your request :(" };
local http_base = config.get("*", "core", "http_path") or "www_files";
local response_400 = { status = "400 Bad Request", body = "<h1>Bad Request</h1>Sorry, we didn't understand your request :(" };
local response_404 = { status = "404 Not Found", body = "<h1>Page Not Found</h1>Sorry, we couldn't find what you were looking for :(" };
-- TODO: Should we read this from /etc/mime.types if it exists? (startup time...?)
local response_404 = { status = "404 Not Found", body = "<h1>Page Not Found</h1>Sorry, we couldn't find what you were looking for :(" };
-- TODO: Should we read this from /etc/mime.types if it exists? (startup time...?)
local ext = path:match("%.([^.]*)$");
local mime = mime_map[ext]; -- Content-Type should be nil when not known
return {
local ext = path:match("%.([^.]*)$");
local mime = mime_map[ext]; -- Content-Type should be nil when not known
return {