diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-23 19:41:21 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-23 19:41:21 +0100 |
commit | 96233956371f0312e894be5d03675377128af8ad (patch) | |
tree | 34bac28c6727af6e513fc6ee5394b67cff0cfcfe /src/libserver/url.c | |
parent | 9de28291a58ff002ef2e9301ec7f558f1679effc (diff) | |
download | rspamd-96233956371f0312e894be5d03675377128af8ad.tar.gz rspamd-96233956371f0312e894be5d03675377128af8ad.zip |
[Fix] Fix processing of the ip urls in file
Diffstat (limited to 'src/libserver/url.c')
-rw-r--r-- | src/libserver/url.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c index 8ad073ae2..96e3118eb 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -2004,7 +2004,7 @@ rspamd_url_parse (struct rspamd_url *uri, } } - if (uri->protocol & (PROTOCOL_HTTP|PROTOCOL_HTTPS|PROTOCOL_MAILTO|PROTOCOL_FTP)) { + if (uri->protocol & (PROTOCOL_HTTP|PROTOCOL_HTTPS|PROTOCOL_MAILTO|PROTOCOL_FTP|PROTOCOL_FILE)) { /* Find TLD part */ rspamd_multipattern_lookup (url_scanner->search_trie, uri->host, uri->hostlen, @@ -2017,9 +2017,11 @@ rspamd_url_parse (struct rspamd_url *uri, return URI_ERRNO_TLD_MISSING; } } else { - /* Assume tld equal to host */ - uri->tld = uri->host; - uri->tldlen = uri->hostlen; + if (!rspamd_url_is_ip (uri, pool)) { + /* Assume tld equal to host */ + uri->tld = uri->host; + uri->tldlen = uri->hostlen; + } } } } |