aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_http_files.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua
index 47423f55..70ef5623 100644
--- a/plugins/mod_http_files.lua
+++ b/plugins/mod_http_files.lua
@@ -118,8 +118,8 @@ function serve_file(event, path)
if not data then
return 403;
end
- local ext = path:match("%.([^.]*)$");
- local content_type = mime_map[ext];
+ local ext = path:match("%.([^./]+)$");
+ local content_type = ext and mime_map[ext];
cache[path] = { data = data; content_type = content_type; };
response_headers.content_type = content_type;
end