Skip to content

Commit

Permalink
Merge pull request #3389 from moisseev/selectors
Browse files Browse the repository at this point in the history
[Minor] Fix HTTP status code
  • Loading branch information
vstakhov committed Jun 3, 2020
2 parents 7eb8a6f + 8e16299 commit 2a59d43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rules/controller/selectors.lua
Expand Up @@ -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
Expand Down Expand Up @@ -74,4 +70,4 @@ return {
enable = true,
need_task = true,
}
}
}

0 comments on commit 2a59d43

Please sign in to comment.