summaryrefslogtreecommitdiffstats
path: root/src/libserver/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver/url.c')
-rw-r--r--src/libserver/url.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index 4d0969a97..eeaf0eebe 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -323,7 +323,12 @@ rspamd_url_strerror (enum uri_errno err)
return "Invalid symbols encoded";
case URI_ERRNO_INVALID_PORT:
return "Port number is bad";
+ case URI_ERRNO_TLD_MISSING:
+ return "TLD part is not detected";
+ case URI_ERRNO_HOST_MISSING:
+ return "Host part is missing";
}
+
return NULL;
}
@@ -1501,7 +1506,7 @@ rspamd_url_parse (struct rspamd_url *uri, gchar *uristring, gsize len,
uri->port = u.port;
if (!uri->hostlen) {
- return URI_ERRNO_BAD_FORMAT;
+ return URI_ERRNO_HOST_MISSING;
}
/* Now decode url symbols */
@@ -1552,7 +1557,7 @@ rspamd_url_parse (struct rspamd_url *uri, gchar *uristring, gsize len,
rspamd_tld_trie_callback, uri, &state, true) == 0) {
/* Ignore URL's without TLD if it is not a numeric URL */
if (!rspamd_url_is_ip (uri, pool)) {
- return URI_ERRNO_BAD_FORMAT;
+ return URI_ERRNO_TLD_MISSING;
}
}