aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r--src/libutil/http.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index 615f21de6..1e0d37017 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -558,6 +558,10 @@ rspamd_http_on_headers_complete (http_parser * parser)
priv->msg->body = g_string_sized_new (BUFSIZ);
}
+ if (parser->flags & F_SPAMC) {
+ priv->msg->flags |= RSPAMD_HTTP_FLAG_SPAMC;
+ }
+
priv->msg->body_buf.str = priv->msg->body->str;
priv->msg->method = parser->method;
priv->msg->code = parser->status_code;
@@ -1117,7 +1121,12 @@ rspamd_http_connection_write_message (struct rspamd_http_connection *conn,
}
else {
/* Legacy spamd reply */
- rspamd_printf_gstring (buf, "RSPAMD/1.3 0 EX_OK\r\n");
+ if (msg->flags & RSPAMD_HTTP_FLAG_SPAMC) {
+ rspamd_printf_gstring (buf, "SPAMD/1.1 0 EX_OK\r\n");
+ }
+ else {
+ rspamd_printf_gstring (buf, "RSPAMD/1.3 0 EX_OK\r\n");
+ }
}
}
else {