]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Apply black formatting (Tho it looks like a broken case to me?)
authorTom Christie <tom@tomchristie.com>
Tue, 3 Sep 2019 14:01:37 +0000 (15:01 +0100)
committerTom Christie <tom@tomchristie.com>
Tue, 3 Sep 2019 14:01:37 +0000 (15:01 +0100)
example.py [new file with mode: 0644]
httpx/middleware.py

diff --git a/example.py b/example.py
new file mode 100644 (file)
index 0000000..b72c9f6
--- /dev/null
@@ -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)
index 670d96bc113b6ad0186b6245eab709b418af3292..b1aeb216f7b4a35798db8e69d238338d5378b8f7 100644 (file)
@@ -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