aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-12-10 16:36:33 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-12-10 16:36:33 +0500
commitc7fa0dd97ed2d133d4182b12a0c4a21f66b77fe4 (patch)
tree0a47e5b50d0ebff78996bbe731db8a65f57c2b7f
parent74e0382621bd0e5dd4c30cc19de014f9c30b91f8 (diff)
downloadprosody-c7fa0dd97ed2d133d4182b12a0c4a21f66b77fe4.tar.gz
prosody-c7fa0dd97ed2d133d4182b12a0c4a21f66b77fe4.zip
net.httpserver: Removed mime handling (now in mod_httpserver). Unknown dynamic content is now always served as text/html.
-rw-r--r--net/httpserver.lua7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/httpserver.lua b/net/httpserver.lua
index ddb68f03..4eaea71d 100644
--- a/net/httpserver.lua
+++ b/net/httpserver.lua
@@ -23,9 +23,6 @@ local urlencode = function (s) return s and (s:gsub("%W", function (c) return st
local log = require "util.logger".init("httpserver");
--- TODO: Should we read this from /etc/mime.types if it exists? (startup time...?)
-local mime_map = { html = "text/html", txt = "plain/text; charset=utf-8", js = "text/javascript" };
-
local http_servers = {};
module "httpserver"
@@ -68,9 +65,7 @@ local function send_response(request, response)
resp = { "HTTP/1.0 200 OK\r\n" };
t_insert(resp, "Connection: close\r\n");
- t_insert(resp, "Content-Type: ");
- t_insert(resp, mime_map[request.url.path:match("%.(%w+)")] or "application/octet-stream");
- t_insert(resp, "\r\n");
+ t_insert(resp, "Content-Type: text/html\r\n");
t_insert(resp, "Content-Length: ");
t_insert(resp, #response);
t_insert(resp, "\r\n\r\n");