]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Fixed redirect loop (#734)
authorYurii Ohorodnik <59605275+yuriiohorodnik@users.noreply.github.com>
Tue, 7 Jan 2020 16:13:06 +0000 (18:13 +0200)
committerTom Christie <tom@tomchristie.com>
Tue, 7 Jan 2020 16:13:06 +0000 (16:13 +0000)
* fixed redirect loop

* linted with flake8

* linted with flake8

httpx/client.py

index 2cc45c024af301df658f9d0001afab360181d973..5725e404f6241ec23e17f69a4695b56255872ffe 100644 (file)
@@ -617,7 +617,8 @@ class AsyncClient:
         while True:
             if len(history) > self.max_redirects:
                 raise TooManyRedirects()
-            if request.url in (response.url for response in history):
+            urls = ((resp.request.method, resp.url) for resp in history)
+            if (request.method, request.url) in urls:
                 raise RedirectLoop()
 
             response = await self.send_handling_auth(