commit fcc1c2c: [Minor] Settings: Fix parsing of the settings map

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Mar 26 12:42:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-03-26 12:36:31 +0000
URL: https://github.com/rspamd/rspamd/commit/fcc1c2c29d3e30a80dd9738a50687b5b45e9ea42 (HEAD -> master)

[Minor] Settings: Fix parsing of the settings map

---
 src/plugins/lua/settings.lua | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index 7427e779d..b497d4388 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -1038,7 +1038,14 @@ end
 local settings_map_pool
 local function process_settings_map(map_text)
   local parser = ucl.parser()
-  local res,err = parser:parse_string(map_text)
+  local res,err
+
+  if type(map_text) == 'string' then
+    res,err = parser:parse_string(map_text)
+  else
+    res,err = parser:parse_text(map_text)
+  end
+
   if not res then
     rspamd_logger.warnx(rspamd_config, 'cannot parse settings map: ' .. err)
   else


More information about the Commits mailing list