From 0f22039bcadd26c2745f609085bcfdbba35b4945 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 18 Jan 2014 22:55:40 +0100 Subject: [PATCH] add CONNECT request to list of request types that don't have a response body --- netlib/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlib/http.py b/netlib/http.py index 454edb3a9..51f85627c 100644 --- a/netlib/http.py +++ b/netlib/http.py @@ -313,7 +313,7 @@ def read_response(rfile, method, body_size_limit): raise HttpError(502, "Invalid headers.") # Parse response body according to http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-16#section-3.3 - if method == "HEAD" or (code in [204, 304]) or 100 <= code <= 199: + if method in ["HEAD", "CONNECT"] or (code in [204, 304]) or 100 <= code <= 199: content = "" else: content = read_http_body(rfile, headers, body_size_limit, False)