mod_http_files: Make sure file extensions are not nil or empty string

remotes/origin/0.11
Kim Alvefur 13 years ago
parent dc08340e9f
commit 0ff07edb45
  1. 4
      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

Loading…
Cancel
Save