Software /
code /
prosody
Diff
net/http/server.lua @ 4788:e14f5a156571
net.http.server: Code cleanup/adjustment now that send_response() accepts response.body
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 28 Apr 2012 19:36:57 +0100 |
parent | 4787:1d753fecf95b |
child | 5300:fcb1be0b4a5c |
line wrap: on
line diff
--- 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