msg->date = time (NULL);
msg->code = code;
msg->body = g_string_sized_new (128);
+ msg->status = g_string_new (error_msg);
rspamd_printf_gstring (msg->body, "{\"error\":\"%s\"}", error_msg);
rspamd_http_connection_reset (entry->conn);
rspamd_http_connection_write_message (entry->conn, msg, NULL,
"Date: %s\r\n"
"Content-Length: %z\r\n"
"Content-Type: %s\r\n",
- msg->code, rspamd_http_code_to_str (msg->code),
+ msg->code,
+ msg->status ? msg->status->str : rspamd_http_code_to_str (msg->code),
"rspamd/" RVERSION,
datebuf,
bodylen,
else if (!processed) {
msg_warn ("processing of message failed");
rspamd_task_free (task, FALSE);
- rspamd_controller_send_error (conn_ent, 404, "No fuzzy rules matchedr");
+ rspamd_controller_send_error (conn_ent, 404, "No fuzzy rules matched");
return;
}