From a36c70a6e354b4c7baf4047ed7db01a3ff76080c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 4 May 2018 13:38:05 +0100 Subject: [PATCH] [Minor] Set correct HTTP method when proxying connections --- src/rspamd_proxy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index a4e98a075..4bdfd56d9 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -1399,8 +1399,6 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session) continue; } - msg->method = HTTP_GET; - if (msg->url->len == 0) { msg->url = rspamd_fstring_append (msg->url, "/check", strlen ("/check")); } @@ -1432,6 +1430,7 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session) rspamd_http_message_add_header (msg, "File", session->fname); } + msg->method = HTTP_GET; rspamd_http_connection_write_message_shared (bk_conn->backend_conn, msg, NULL, NULL, bk_conn, bk_conn->backend_sock, @@ -1442,6 +1441,8 @@ proxy_open_mirror_connections (struct rspamd_proxy_session *session) rspamd_http_message_set_body (msg, session->map, session->map_len); } + msg->method = HTTP_POST; + if (m->compress) { proxy_request_compress (msg); @@ -1857,6 +1858,8 @@ retry: rspamd_http_message_add_header (msg, "File", session->fname); } + msg->method = HTTP_GET; + rspamd_http_connection_write_message_shared ( session->master_conn->backend_conn, msg, NULL, NULL, session->master_conn, @@ -1869,6 +1872,8 @@ retry: session->map, session->map_len); } + msg->method = HTTP_POST; + if (backend->compress) { proxy_request_compress (msg); if (session->client_milter_conn) { -- 2.39.5