From 0ff07edb453e5afd98e7236ed467034bf9fb4e33 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Dec 2012 08:19:58 +0100 Subject: mod_http_files: Make sure file extensions are not nil or empty string --- plugins/mod_http_files.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/mod_http_files.lua') 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 -- cgit v1.2.3