From 51a80e4844f80f9b73df117818c5dbcc0c9a2a05 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 31 Jan 2013 15:17:19 +0000 Subject: [PATCH] Do not output headers when serving Lua server pages --- mongoose.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index d95df003..6816f9fa 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4033,8 +4033,7 @@ static void handle_lsp_request(struct mg_connection *conn, const char *path, } else if ((L = luaL_newstate()) == NULL) { send_http_error(conn, 500, http_500_error, "%s", "y"); } else { - mg_printf(conn, "%s", "HTTP/1.1 200 OK\r\n" - "Content-Type: text/html\r\nConnection: close\r\n\r\n"); + // We're not sending HTTP headers here, Lua page must do it. prepare_lua_environment(conn, L); conn->request_info.ev_data = L; call_user(conn, MG_INIT_LUA);