# HG changeset patch # User Matthew Wild # Date 1335638217 -3600 # Node ID e14f5a156571be9c06a40f2a0167b962dc84469c # Parent 1d753fecf95b732dd5b81f7a7c68bf407e1d4c1e net.http.server: Code cleanup/adjustment now that send_response() accepts response.body diff -r 1d753fecf95b -r e14f5a156571 net/http/server.lua --- a/net/http/server.lua Sat Apr 28 19:36:09 2012 +0100 +++ b/net/http/server.lua Sat Apr 28 19:36:57 2012 +0100 @@ -196,7 +196,7 @@ 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 @@ 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