mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
net.http.server: Log request and response status lines
Points out the beginning and end of a request.
This commit is contained in:
parent
fe8e6dc8ca
commit
ff0b9242e3
1 changed files with 3 additions and 0 deletions
|
@ -236,6 +236,8 @@ function handle_request(conn, request, finish_cb)
|
||||||
request.headers = headers;
|
request.headers = headers;
|
||||||
request.conn = conn;
|
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 date_header = os_date('!%a, %d %b %Y %H:%M:%S GMT'); -- FIXME use
|
||||||
local conn_header = request.headers.connection;
|
local conn_header = request.headers.connection;
|
||||||
conn_header = conn_header and ","..conn_header:gsub("[ \t]", ""):lower().."," or ""
|
conn_header = conn_header and ","..conn_header:gsub("[ \t]", ""):lower().."," or ""
|
||||||
|
@ -327,6 +329,7 @@ end
|
||||||
|
|
||||||
local function prepare_header(response)
|
local function prepare_header(response)
|
||||||
local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]);
|
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 headers = response.headers;
|
||||||
local output = { status_line };
|
local output = { status_line };
|
||||||
for k,v in pairs(headers) do
|
for k,v in pairs(headers) do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue