From: Tom Christie Date: Tue, 3 Sep 2019 14:01:37 +0000 (+0100) Subject: Apply black formatting (Tho it looks like a broken case to me?) X-Git-Tag: 0.7.3~21^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a2d58b8f13818ef02776d6a2f6d9386c9bc5543;p=thirdparty%2Fhttpx.git Apply black formatting (Tho it looks like a broken case to me?) --- diff --git a/example.py b/example.py new file mode 100644 index 00000000..b72c9f6e --- /dev/null +++ b/example.py @@ -0,0 +1,17 @@ +import httpx +import time +import requests + +url = "https://httpbin.org/stream-bytes/50000000" + +start = time.time() +r = requests.get(url) +print("requests %.1f s" % (time.time() - start)) + +for http_version in ["HTTP/1.1", "HTTP/2"]: + client = httpx.Client(http_versions=http_version) + + start = time.time() + r = client.get(url) + print("httpx %s %.1f s" % (http_version, time.time() - start)) + print(r.http_version) diff --git a/httpx/middleware.py b/httpx/middleware.py index 670d96bc..b1aeb216 100644 --- a/httpx/middleware.py +++ b/httpx/middleware.py @@ -151,7 +151,7 @@ class RedirectMiddleware(BaseMiddleware): del headers["Host"] if method != request.method and method == "GET": - # Strip Content-Length headers when we've switch to a 'GET' request. + #  Strip Content-Length headers when we've switch to a 'GET' request. del headers["Content-Length"] return headers