From: Yurii Ohorodnik <59605275+yuriiohorodnik@users.noreply.github.com> Date: Tue, 7 Jan 2020 16:13:06 +0000 (+0200) Subject: Fixed redirect loop (#734) X-Git-Tag: 0.11.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=387f04732baa99ea472c6f78c905a9359b3d0e0e;p=thirdparty%2Fhttpx.git Fixed redirect loop (#734) * fixed redirect loop * linted with flake8 * linted with flake8 --- diff --git a/httpx/client.py b/httpx/client.py index 2cc45c02..5725e404 100644 --- a/httpx/client.py +++ b/httpx/client.py @@ -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(