net.http.server: Fix some typos introduced in 420c0d3b8583.
authorDaurnimator <quae@daurnimator.com>
Tue, 15 Apr 2014 14:51:49 -0400
changeset 6082 d0e824a21861
parent 6080 b7d1607df87d
child 6083 31b2f82e2d3c
child 6084 3c02a9ed399e
net.http.server: Fix some typos introduced in 420c0d3b8583.
net/http/server.lua
--- a/net/http/server.lua	Tue Apr 15 01:02:56 2014 +0200
+++ b/net/http/server.lua	Tue Apr 15 14:51:49 2014 -0400
@@ -255,18 +255,17 @@
 		t_insert(output, headerfix[k]..v);
 	end
 	t_insert(output, "\r\n\r\n");
-	t_insert(output, body);
 	return output;
 end
 _M.prepare_header = prepare_header;
 function _M.send_response(response, body)
 	if response.finished then return; end
 	body = body or response.body or "";
-	headers.content_length = #body;
-	local output = prepare_header(respone);
+	response.headers.content_length = #body;
+	local output = prepare_header(response);
 	t_insert(output, body);
 	response.conn:write(t_concat(output));
-	response:finish();
+	response:done();
 end
 function _M.finish_response(response)
 	if response.finished then return; end