diff --git a/modules/http/http.lua b/modules/http/http.lua index 16f7e32..a83d3aa 100644 --- a/modules/http/http.lua +++ b/modules/http/http.lua @@ -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() diff --git a/modules/http/pool.go b/modules/http/pool.go index cb50342..159f1fb 100644 --- a/modules/http/pool.go +++ b/modules/http/pool.go @@ -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() diff --git a/modules/string+/string.lua b/modules/string+/string.lua index 28dee2a..790a33d 100644 --- a/modules/string+/string.lua +++ b/modules/string+/string.lua @@ -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)