net.http.server: Fix some typos introduced in 420c0d3b8583.
authorDaurnimator <quae@daurnimator.com>
Tue, 15 Apr 2014 18:51:49 +0000 (14:51 -0400)
committerDaurnimator <quae@daurnimator.com>
Tue, 15 Apr 2014 18:51:49 +0000 (14:51 -0400)
net/http/server.lua

index 25fce43ffd4e648819f5c6f78bcdce65de9e4a67..510b77fbd1fbfeb62ccfc1dd3f9be4d6f5cf124c 100644 (file)
@@ -255,18 +255,17 @@ local function prepare_header(response)
                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