diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-21 08:19:58 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-21 08:19:58 +0100 |
commit | 19473b8b72ce4060039e768f3c9255c15847c055 (patch) | |
tree | c69a58773307b6b4a2334740e2465344d048409e | |
parent | bf297afdb61032b38c060eee47f2ca3f1aa07ad3 (diff) | |
download | prosody-19473b8b72ce4060039e768f3c9255c15847c055.tar.gz prosody-19473b8b72ce4060039e768f3c9255c15847c055.zip |
mod_http_files: Make sure file extensions are not nil or empty string
-rw-r--r-- | plugins/mod_http_files.lua | 4 |
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 |