]> granicus.if.org Git - libevent/commitdiff
http: do not assume body for CONNECT
authorAzat Khuzhin <azat@libevent.org>
Sun, 12 Jan 2020 10:43:18 +0000 (13:43 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sun, 12 Jan 2020 12:33:59 +0000 (15:33 +0300)
http.c

diff --git a/http.c b/http.c
index 533915d20c2bb36473c591bfede5a2466a56b304..2f0bdd21818e6cc9e34a04b87026ddcbe9501700 100644 (file)
--- a/http.c
+++ b/http.c
@@ -417,6 +417,7 @@ evhttp_response_needs_body(struct evhttp_request *req)
        return (req->response_code != HTTP_NOCONTENT &&
                req->response_code != HTTP_NOTMODIFIED &&
                (req->response_code < 100 || req->response_code >= 200) &&
+               req->type != EVHTTP_REQ_CONNECT &&
                req->type != EVHTTP_REQ_HEAD);
 }