mod_httpserver: Skip returning a Content-Type when not known (application/octet-stream is not a correct default).
--- a/plugins/mod_httpserver.lua Thu Dec 10 16:22:34 2009 +0500
+++ b/plugins/mod_httpserver.lua Thu Dec 10 16:25:50 2009 +0500
@@ -52,11 +52,8 @@
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;