comparison mod_http_logging/mod_http_logging.lua @ 2971:c89be016a075

mod_http_logging: Fix typo [luacheck]
author Kim Alvefur <zash@zash.se>
date Fri, 30 Mar 2018 13:41:56 +0200
parents 8681729a47d5
children
comparison
equal deleted inserted replaced
2970:c5122b7633a8 2971:c89be016a075
15 local server = require "net.http.server"; 15 local server = require "net.http.server";
16 16
17 local function get_content_len(response, body) 17 local function get_content_len(response, body)
18 local len = response.headers.content_length; 18 local len = response.headers.content_length;
19 if len then return len; end 19 if len then return len; end
20 if not body then body = request.body; end 20 if not body then body = response.body; end
21 if body then return #tostring(body); end 21 if body then return #tostring(body); end
22 end 22 end
23 23
24 local function log_response(response, body) 24 local function log_response(response, body)
25 local len = tostring(get_content_len(response, body) or "-"); 25 local len = tostring(get_content_len(response, body) or "-");