aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-26 12:36:31 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-03-26 12:36:31 +0000
commitfcc1c2c29d3e30a80dd9738a50687b5b45e9ea42 (patch)
tree6b9e3ff3dd84f1a104c859569f855b358f3c4a73
parent3a8cba17a08903a1fba0f0434cc02f6e0a8038d1 (diff)
downloadrspamd-fcc1c2c29d3e30a80dd9738a50687b5b45e9ea42.tar.gz
rspamd-fcc1c2c29d3e30a80dd9738a50687b5b45e9ea42.zip
[Minor] Settings: Fix parsing of the settings map
-rw-r--r--src/plugins/lua/settings.lua9
1 files changed, 8 insertions, 1 deletions
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