aboutsummaryrefslogtreecommitdiffstats
path: root/net/http/server.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-28 19:36:57 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-28 19:36:57 +0100
commit2f5ffa76dcb1a7a5968b8cb4d5a20041b7d81d56 (patch)
treead21d7bcc85125b0478f61abd2ff6c77e3cdac24 /net/http/server.lua
parentcd8b026b999a7b7abc77f557302ac751982f6d6d (diff)
downloadprosody-2f5ffa76dcb1a7a5968b8cb4d5a20041b7d81d56.tar.gz
prosody-2f5ffa76dcb1a7a5968b8cb4d5a20041b7d81d56.zip
net.http.server: Code cleanup/adjustment now that send_response() accepts response.body
Diffstat (limited to 'net/http/server.lua')
-rw-r--r--net/http/server.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/http/server.lua b/net/http/server.lua
index e15e6e14..69908e4e 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -196,7 +196,7 @@ function handle_request(conn, request, finish_cb)
local result = events.fire_event(event, payload);
if result ~= nil then
if result ~= true then
- local body = "";
+ local body;
local result_type = type(result);
if result_type == "number" then
response.status_code = result;
@@ -206,8 +206,6 @@ function handle_request(conn, request, finish_cb)
elseif result_type == "string" then
body = result;
elseif result_type == "table" then
- body = result.body;
- result.body = nil;
for k, v in pairs(result) do
response[k] = v;
end