From: Waqas Hussain Date: Thu, 10 Dec 2009 11:25:50 +0000 (+0500) Subject: mod_httpserver: Skip returning a Content-Type when not known (application/octet-strea... X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=4655b9d3c169969a9d11275157f5e7527585a869;p=prosody.git mod_httpserver: Skip returning a Content-Type when not known (application/octet-stream is not a correct default). --- 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;