From d834a31a5ab6f963e38bf0185c30eb0bd74270f9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 29 Nov 2021 17:28:20 +0000 Subject: [PATCH] [Minor] Remove unused function --- lualib/lua_mime.lua | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lualib/lua_mime.lua b/lualib/lua_mime.lua index 2768195bd..968d38c0a 100644 --- a/lualib/lua_mime.lua +++ b/lualib/lua_mime.lua @@ -579,26 +579,13 @@ end exports.message_to_ucl = function(task, stringify_content) local E = {} - local function flatten_headers(hdrs) - local res = {} - - for _,e in ipairs(hdrs) do - if type(e) == 'table' and e[1] then - for _,h in ipairs(e) do table.insert(res, h) end - else - table.insert(res, e) - end - end - - return res - end local maybe_stringify_f = stringify_content and tostring or function(t) return t end local result = { size = task:get_size(), digest = task:get_digest(), newlines = task:get_newlines_type(), - headers = flatten_headers(task:get_headers(true) or E) + headers = task:get_headers(true) } -- Utility to convert ip addr to a string or nil if invalid/absent @@ -630,7 +617,7 @@ exports.message_to_ucl = function(task, stringify_content) detected_type = string.format('%s/%s', part:get_detected_type()), filename = part:get_filename(), content = maybe_stringify_f(part:get_content()), - headers = flatten_headers(part:get_headers(true) or E), + headers = part:get_headers(true) or E, boundary = part:get_enclosing_boundary() } table.insert(result.parts, p) -- 2.39.5