aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_httpserver.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-12-10 16:25:50 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-12-10 16:25:50 +0500
commiteeee71ebc14b11389266a04ac29f0adf0710a16f (patch)
treef0cf484a5050b8aefdd679a549026b4b7839d5cd /plugins/mod_httpserver.lua
parent01034310135e2240fb5726370cf53bc8efa61d0d (diff)
downloadprosody-eeee71ebc14b11389266a04ac29f0adf0710a16f.tar.gz
prosody-eeee71ebc14b11389266a04ac29f0adf0710a16f.zip
mod_httpserver: Skip returning a Content-Type when not known (application/octet-stream is not a correct default).
Diffstat (limited to 'plugins/mod_httpserver.lua')
-rw-r--r--plugins/mod_httpserver.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/plugins/mod_httpserver.lua b/plugins/mod_httpserver.lua
index 80835019..24247596 100644
--- a/plugins/mod_httpserver.lua
+++ b/plugins/mod_httpserver.lua
@@ -52,11 +52,8 @@ function serve_file(path)
local data = f:read("*a");
f:close();
local ext = path:match("%.([^.]*)$");
- local mime = mime_map[ext];
- if not mime then
- mime = ext and "application/octet-stream" or "text/html";
- end
- module:log("warn", "ext: %s, mime: %s", ext, mime);
+ local mime = mime_map[ext]; -- Content-Type should be nil when not known
+ module:log("warn", "ext: %s, mime: %s", ext or "(nil)", mime or "(nil)");
return {
headers = { ["Content-Type"] = mime; };
body = data;