From 3a3b6cef3e361f3e39bd78e3701a51d426ba8c12 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Apr 2021 17:24:18 +0100 Subject: [PATCH] [Minor] Use rspamd_url flags to avoid sync issues --- lualib/lua_selectors/extractors.lua | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua index f8d8baf03..705cb5031 100644 --- a/lualib/lua_selectors/extractors.lua +++ b/lualib/lua_selectors/extractors.lua @@ -17,35 +17,12 @@ limitations under the License. local fun = require 'fun' local meta_functions = require "lua_meta" local lua_util = require "lua_util" +local rspamd_url = require "rspamd_url" local common = require "lua_selectors/common" local ts = require("tableshape").types local E = {} -local url_flags_ts = ts.array_of(ts.one_of{ - 'content', - 'has_port', - 'has_user', - 'host_encoded', - 'html_displayed', - 'idn', - 'image', - 'missing_slahes', -- sic - 'no_tld', - 'numeric', - 'obscured', - 'path_encoded', - 'phished', - 'query', - 'query_encoded', - 'redirected', - 'schema_encoded', - 'schemaless', - 'subject', - 'text', - 'unnormalised', - 'url_displayed', - 'zw_spaces', - }):is_optional() +local url_flags_ts = ts.array_of(ts.one_of(lua_util.keys(rspamd_url.flags))):is_optional() local function gen_exclude_flags_filter(exclude_flags) return function(u) -- 2.39.5