]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix schema and add size in all cases
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Dec 2021 11:02:32 +0000 (11:02 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Dec 2021 11:02:32 +0000 (11:02 +0000)
lualib/lua_mime.lua

index 1646b892c1d75bdd5df96bbb096ba8ac1f7a2f66..2128b29a650ea179fea03895a1622d168bf0f950 100644 (file)
@@ -626,6 +626,7 @@ exports.message_to_ucl = function(task, stringify_content)
         type = string.format('%s/%s', part:get_type()),
         headers =  part:get_headers(true) or E,
         boundary = part:get_enclosing_boundary(),
+        size = 0,
       }
 
       if part:is_multipart() then
@@ -661,7 +662,8 @@ exports.message_to_ucl_schema = function()
 
   local function part_schema()
     return ts.shape{
-      content =  ts.string:describe('Decoded content'),
+      content =  ts.string:describe('Decoded content'):is_optional(),
+      multipart_boundary = ts.string:describe('Multipart service boundary'):is_optional(),
       size = ts.integer:describe('Size of the part'),
       type = ts.string:describe('Announced type'):is_optional(),
       detected_type = ts.string:describe('Detected type'):is_optional(),