From 62460850a80dd221e9d6fdfd6470f7f5ce391a41 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 10 Dec 2009 16:25:50 +0500 Subject: mod_httpserver: Skip returning a Content-Type when not known (application/octet-stream is not a correct default). --- plugins/mod_httpserver.lua | 7 ++----- 1 file 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; -- cgit v1.2.3