]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Try to fix proxying of stupid spamc protocol to HTTP mirrors
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 May 2016 18:30:30 +0000 (19:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 26 May 2016 18:30:30 +0000 (19:30 +0100)
src/libutil/http.c
src/rspamd_proxy.c

index 0e0f30eafa7576d00e34bcdfdc0aed26201c6d54..fc8263ddddf5c2d0c764284d045ab13e3b80c913 100644 (file)
@@ -1204,8 +1204,14 @@ rspamd_http_connection_copy_msg (struct rspamd_http_connection *conn)
        }
 
        if (msg->url) {
-               new_msg->url = rspamd_fstring_new_init (msg->url->str,
-                               msg->url->len);
+               if (new_msg->url) {
+                       new_msg->url = rspamd_fstring_append (new_msg->url, msg->url->str,
+                                                               msg->url->len);
+               }
+               else {
+                       new_msg->url = rspamd_fstring_new_init (msg->url->str,
+                                       msg->url->len);
+               }
        }
 
        if (msg->host) {
index 4d6ae4b6d793e467f6b5f7dd5934aefa6fe0333e..2fb8d0b5089d6a994130972745f8ebb76a756184 100644 (file)
@@ -907,6 +907,11 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session)
                msg = rspamd_http_connection_copy_msg (session->client_conn);
                rspamd_http_message_remove_header (msg, "Content-Length");
                rspamd_http_message_remove_header (msg, "Key");
+               msg->method = HTTP_GET;
+
+               if (msg->url->len == 0) {
+                       msg->url = rspamd_fstring_append (msg->url, "/check", strlen ("/check"));
+               }
 
                if (m->settings_id != NULL) {
                        rspamd_http_message_remove_header (msg, "Settings-ID");