aboutsummaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-02-27 17:14:16 +0100
committerKim Alvefur <zash@zash.se>2024-02-27 17:14:16 +0100
commitf7b35d516fd0e820e22d7ec1a51c98b456fd3375 (patch)
tree81b49d4d239571b4a7f715eb4e68da4dc84c93cc /net/http
parent4ca636bb7ea175908c46b97de1002028fb7a79f7 (diff)
downloadprosody-f7b35d516fd0e820e22d7ec1a51c98b456fd3375.tar.gz
prosody-f7b35d516fd0e820e22d7ec1a51c98b456fd3375.zip
net.http.files: Validate argument to setup function
Fixes error in #1765 by throwing an error earlier
Diffstat (limited to 'net/http')
-rw-r--r--net/http/files.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/http/files.lua b/net/http/files.lua
index 583f7514..01c46a2c 100644
--- a/net/http/files.lua
+++ b/net/http/files.lua
@@ -58,7 +58,7 @@ local function serve(opts)
local cache = new_cache(opts.cache_size or 256);
local cache_max_file_size = tonumber(opts.cache_max_file_size) or 1024
-- luacheck: ignore 431
- local base_path = opts.path;
+ local base_path = assert(opts.path, "invalid argument to net.http.files.path(), missing required 'path'");
local dir_indices = opts.index_files or { "index.html", "index.htm" };
local directory_index = opts.directory_index;
local function serve_file(event, path)