Software /
code /
prosody
Changeset
2772:18d83fd07db1
mod_httpserver: Skip returning a Content-Type when not known (application/octet-stream is not a correct default).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 10 Dec 2009 16:25:50 +0500 |
parents | 2771:c9834f338a4e |
children | 2773:591c8ae9ae09 |
files | plugins/mod_httpserver.lua |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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;