summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/lua_config.c')
-rw-r--r--src/lua/lua_config.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index d495d0c9e..b574cba59 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -1588,21 +1588,7 @@ lua_config_register_regexp (lua_State *L)
}
}
else {
- if (strcmp (type_str, "header") == 0) {
- type = RSPAMD_RE_HEADER;
- }
- else if (strcmp (type_str, "rawheader") == 0) {
- type = RSPAMD_RE_RAWHEADER;
- }
- else if (strcmp (type_str, "mime") == 0) {
- type = RSPAMD_RE_MIME;
- }
- else if (strcmp (type_str, "body") == 0) {
- type = RSPAMD_RE_BODY;
- }
- else if (strcmp (type_str, "url") == 0) {
- type = RSPAMD_RE_URL;
- }
+ type = rspamd_re_cache_type_from_string (type_str);
if ((type == RSPAMD_RE_HEADER || type == RSPAMD_RE_RAWHEADER)
&& header_str == NULL) {