From d4578e06775bd9bdb6bef6eaf9b5d1516bc77767 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 28 Apr 2012 19:36:57 +0100 Subject: net.http.server: Code cleanup/adjustment now that send_response() accepts response.body --- net/http/server.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'net/http') 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 -- cgit v1.2.3