]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Apply lua augmentations where available
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 17 Dec 2022 20:38:24 +0000 (20:38 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 17 Dec 2022 20:38:24 +0000 (20:38 +0000)
lualib/lua_maps.lua

index a436a60f0b78404bf2c1eeac64ce70cb24b3f8d0..362f543657ad079706542435468498c627c5de41 100644 (file)
@@ -449,6 +449,14 @@ local function rspamd_map_add_from_ucl(opt, mtype, description, callback)
               parse_err)
         end
       else
+        -- Adjust lua specific augmentations in a trivial case
+        if type(opt.url) == 'string' then
+          local nsrc,ntype = maybe_adjust_type(opt.url, mtype)
+          if nsrc and ntype then
+            opt.url = nsrc
+            mtype = ntype
+          end
+        end
         -- We have some non-trivial object so let C code to deal with it somehow...
         local map = rspamd_config:add_map{
           type = mtype,