commit 3a3b6ce: [Minor] Use rspamd_url flags to avoid sync issues

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Apr 19 16:28:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-04-19 17:24:18 +0100
URL: https://github.com/rspamd/rspamd/commit/3a3b6cef3e361f3e39bd78e3701a51d426ba8c12

[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)


More information about the Commits mailing list