# HG changeset patch # User Kim Alvefur # Date 1684082678 -7200 # Node ID 4e112b87543d0177fface3597029eb7836fa6315 # Parent c975dafa4303bf0eee1fe943bc1a7fb432c72c66 net.http.server: Log request and response status lines Points out the beginning and end of a request. diff -r c975dafa4303 -r 4e112b87543d net/http/server.lua --- a/net/http/server.lua Sun May 14 18:44:11 2023 +0200 +++ b/net/http/server.lua Sun May 14 18:44:38 2023 +0200 @@ -236,6 +236,8 @@ request.headers = headers; request.conn = conn; + request.log("debug", "%s %s HTTP/%s", request.method, request.path, request.httpversion); + local date_header = os_date('!%a, %d %b %Y %H:%M:%S GMT'); -- FIXME use local conn_header = request.headers.connection; conn_header = conn_header and ","..conn_header:gsub("[ \t]", ""):lower().."," or "" @@ -327,6 +329,7 @@ local function prepare_header(response) local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]); + response.log("debug", "%s", status_line); local headers = response.headers; local output = { status_line }; for k,v in pairs(headers) do