minor string fixes

This commit is contained in:
Sky Johnson 2025-07-24 21:49:44 -05:00
parent 8b4a3b27c0
commit d2f0a75d50
3 changed files with 3 additions and 3 deletions

View File

@ -721,7 +721,7 @@ function http.json_parser()
end
function http.logger(format)
format = format or ":method :path :status :response-time ms"
format = format or "${method} ${path} ${status} ${response-time} ms"
return function(req, res, next)
local start_time = os.clock()

View File

@ -96,7 +96,7 @@ func NewWorkerPool(size int, masterState *luajit.State, stateCreator StateCreato
workerCount: size,
}
for i := 0; i < size; i++ {
for i := range size {
worker, err := pool.createWorker(i)
if err != nil {
pool.Close()

View File

@ -642,7 +642,7 @@ function string.template(template_str, vars)
if type(template_str) ~= "string" then error("string.template: first argument must be a string", 2) end
if type(vars) ~= "table" then error("string.template: second argument must be a table", 2) end
return template_str:gsub("%${([%w_%.]+)}", function(path)
return template_str:gsub("%${([%w_%.-]+)}", function(path)
local value = vars
-- Handle simple variables (no dots)