Skip to content

Commit f7356c7

Browse files
author
lex
committed
fix: use gsub count instead of #gmatch (iterator) in is_large_body
1 parent b36382e commit f7356c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/poste/http/format.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ local function is_large_body(body)
8888
local max_bytes = cfg.max_body_bytes or 100 * 1024
8989
local max_lines = cfg.max_body_lines or 500
9090
if #body > max_bytes then return true end
91-
if #body:gmatch("\n") >= max_lines - 1 then return true end
91+
if body:gsub("\n", "\n") >= max_lines - 1 then return true end
9292
return false
9393
end
9494

0 commit comments

Comments
 (0)