# HG changeset patch # User Kim Alvefur # Date 1572646709 -3600 # Node ID 78bda7932f170896efdc56ad4837162eac22421f # Parent 9d20fca6a4854acc74f4f305deb7865a9090ce56 net.http.codes: Avoid implicit number -> string coercion diff -r 9d20fca6a485 -r 78bda7932f17 net/http/codes.lua --- a/net/http/codes.lua Fri Nov 01 23:16:58 2019 +0100 +++ b/net/http/codes.lua Fri Nov 01 23:18:29 2019 +0100 @@ -82,5 +82,5 @@ -- [512-599] = "Unassigned"; }; -for k,v in pairs(response_codes) do response_codes[k] = k.." "..v; end +for k,v in pairs(response_codes) do response_codes[k] = ("%03d %s"):format(k, v); end return setmetatable(response_codes, { __index = function(_, k) return k.." Unassigned"; end })