diff options
Diffstat (limited to 'src/http.c')
-rw-r--r-- | src/http.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/http.c b/src/http.c index 99bb2b867..ccd44f2d8 100644 --- a/src/http.c +++ b/src/http.c @@ -873,6 +873,27 @@ void rspamd_http_message_add_header (struct rspamd_http_message *msg, } } +const gchar* +rspamd_http_message_find_header (struct rspamd_http_message *msg, const gchar *name) +{ + struct rspamd_http_header *hdr; + const gchar *res = NULL; + guint slen = strlen (name); + + if (msg != NULL) { + LL_FOREACH (msg->headers, hdr) { + if (hdr->name->len == slen) { + if (memcmp (hdr->name->str, name, slen) == 0) { + res = hdr->value->str; + break; + } + } + } + } + + return res; +} + /* * HTTP router functions */ |