aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2020-06-03 19:41:52 +0300
committermoisseev <moiseev@mezonplus.ru>2020-06-03 19:41:52 +0300
commit8e162998ac110a4ae294427c6ede73ebfd64d960 (patch)
treebec86c41b496f03e9005ca13672011e1b3507019 /rules
parent7eb8a6f85cc1c65e4b5a83a8c0ef65cb4087e292 (diff)
downloadrspamd-8e162998ac110a4ae294427c6ede73ebfd64d960.tar.gz
rspamd-8e162998ac110a4ae294427c6ede73ebfd64d960.zip
[Minor] Fix HTTP status code
We should treat invalid selector as a negative result of the check.
Diffstat (limited to 'rules')
-rw-r--r--rules/controller/selectors.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/rules/controller/selectors.lua b/rules/controller/selectors.lua
index 58065fc85..905757c76 100644
--- a/rules/controller/selectors.lua
+++ b/rules/controller/selectors.lua
@@ -30,11 +30,7 @@ local function handle_check_selector(_, conn, req_params)
if req_params.selector then
local selector = lua_selectors.create_selector_closure(rspamd_config,
req_params.selector, '', true)
- if not selector then
- conn:send_error(500, 'invalid selector')
- else
- conn:send_ucl({success = true})
- end
+ conn:send_ucl({success = selector and true})
else
conn:send_error(404, 'missing selector')
end
@@ -74,4 +70,4 @@ return {
enable = true,
need_task = true,
}
-} \ No newline at end of file
+}