aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-02-12 15:36:29 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-02-12 15:36:29 +0000
commitf8210a5ba96334cc88ea876c1e496b132c1236c5 (patch)
treea91530a9c1828f9698bb94ada41bee535abcd823 /src/libserver
parentd3a56d950947a01e0a932cf103631033373c57f5 (diff)
downloadrspamd-f8210a5ba96334cc88ea876c1e496b132c1236c5.tar.gz
rspamd-f8210a5ba96334cc88ea876c1e496b132c1236c5.zip
[Test] Add unit tests
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/http/http_message.c10
-rw-r--r--src/libserver/http/http_message.h8
2 files changed, 15 insertions, 3 deletions
diff --git a/src/libserver/http/http_message.c b/src/libserver/http/http_message.c
index 4b68d1ecb..e02827a76 100644
--- a/src/libserver/http/http_message.c
+++ b/src/libserver/http/http_message.c
@@ -736,4 +736,14 @@ bool rspamd_http_message_is_standard_port(struct rspamd_http_message *msg)
}
return msg->port == 80;
+}
+
+const gchar *rspamd_http_message_get_url(struct rspamd_http_message *msg, gsize *len)
+{
+ if (msg->url) {
+ *len = msg->url->len;
+ return msg->url->str;
+ }
+
+ return NULL;
} \ No newline at end of file
diff --git a/src/libserver/http/http_message.h b/src/libserver/http/http_message.h
index fa8ed04c2..a483b316a 100644
--- a/src/libserver/http/http_message.h
+++ b/src/libserver/http/http_message.h
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2019 Vsevolod Stakhov
+/*
+ * Copyright 2024 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -247,6 +247,8 @@ const gchar *rspamd_http_message_get_http_host(struct rspamd_http_message *msg,
*/
bool rspamd_http_message_is_standard_port(struct rspamd_http_message *msg);
+const gchar *rspamd_http_message_get_url(struct rspamd_http_message *msg, gsize *len);
+
#ifdef __cplusplus
}
#endif