From 2b13e3bd340c831ba44f29fb9a8592806971adff Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 11 Oct 2024 09:19:04 -0500 Subject: [PATCH] Small performance improvement to handling redirects (#9467) --- aiohttp/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiohttp/client.py b/aiohttp/client.py index cb89ec839a9..3546b7462c5 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -742,8 +742,8 @@ async def _request( ) from origin_val_err if ( - url.origin() != redirect_origin - and not is_same_host_https_redirect + not is_same_host_https_redirect + and url.origin() != redirect_origin ): auth = None headers.pop(hdrs.AUTHORIZATION, None)