]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Settings: Fix parsing of the settings map
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 Mar 2020 12:36:31 +0000 (12:36 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 Mar 2020 12:36:31 +0000 (12:36 +0000)
src/plugins/lua/settings.lua

index 7427e779da9c5db8e64dc90f7cfdde220de0169a..b497d43889a9aeade50adc0fc74f2cbd9ee62193 100644 (file)
@@ -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