Diff

net/http/server.lua @ 4787:1d753fecf95b

net.http.server: Use response.body if it exists and body is not specified to send_response
author Matthew Wild <mwild1@gmail.com>
date Sat, 28 Apr 2012 19:36:09 +0100
parent 4771:31a40da59308
child 4788:e14f5a156571
line wrap: on
line diff
--- a/net/http/server.lua	Sat Apr 28 18:45:04 2012 +0100
+++ b/net/http/server.lua	Sat Apr 28 19:36:09 2012 +0100
@@ -228,7 +228,7 @@
 	
 	local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]);
 	local headers = response.headers;
-	body = body or "";
+	body = body or response.body or "";
 	headers.content_length = #body;
 
 	local output = { status_line };