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
commit62460850a80dd221e9d6fdfd6470f7f5ce391a41 (patch)
tree90c20c350420891ffef81f168b25dcda7716e542 /plugins/mod_httpserver.lua
parent6a4b442abadbd54d3635b6c6e1d5294f8c436e9b (diff)
downloadprosody-62460850a80dd221e9d6fdfd6470f7f5ce391a41.tar.gz
prosody-62460850a80dd221e9d6fdfd6470f7f5ce391a41.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 119ecadc..08328a43 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;