Changeset

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
parents 4787:1d753fecf95b
children 4789:bed0c6117358
files net/http/server.lua
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
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