aboutsummaryrefslogtreecommitdiffstats
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
commitd4578e06775bd9bdb6bef6eaf9b5d1516bc77767 (patch)
treead21d7bcc85125b0478f61abd2ff6c77e3cdac24
parentcc6bcc5877af74cabd0bb30122973a6ca5d19ae4 (diff)
downloadprosody-d4578e06775bd9bdb6bef6eaf9b5d1516bc77767.tar.gz
prosody-d4578e06775bd9bdb6bef6eaf9b5d1516bc77767.zip
net.http.server: Code cleanup/adjustment now that send_response() accepts response.body
-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