diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-18 13:46:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-18 13:47:52 +0100 |
commit | f59abfc9be6018ceab2ea59a819ac22b8802eeac (patch) | |
tree | cb5a0f8ce1d1964c67109c5ae64b8f7f0ca19651 /src | |
parent | 76a8573d219df1517d30391fb08800d0b7bb50ae (diff) | |
download | rspamd-f59abfc9be6018ceab2ea59a819ac22b8802eeac.tar.gz rspamd-f59abfc9be6018ceab2ea59a819ac22b8802eeac.zip |
[Fix] Fix HTTP methods other than GET and POST
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/http.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index a76ab188e..0df6f190d 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -1961,13 +1961,19 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn pbody = NULL; bodylen = 0; priv->outlen = 2; - msg->method = HTTP_GET; + + if (msg->method == HTTP_INVALID) { + msg->method = HTTP_GET; + } } else { pbody = (gchar *)msg->body_buf.begin; bodylen = msg->body_buf.len; priv->outlen = 3; - msg->method = HTTP_POST; + + if (msg->method == HTTP_INVALID) { + msg->method = HTTP_POST; + } } } else if (msg->body_buf.len > 0) { @@ -2175,7 +2181,7 @@ rspamd_http_new_message (enum http_parser_type type) new->port = 80; new->type = type; - new->method = HTTP_GET; + new->method = HTTP_INVALID; REF_INIT_RETAIN (new, rspamd_http_message_free); |