From 587da1655eda47a8eec126207d592b238465b0ed Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 10 Jan 2019 15:51:35 +0200 Subject: [PATCH] [3.5] Send custom per-request cookies even if session jar is empty (#3515) (#3516) * Send custom per-request cookies even if session jar is empty * Add changenote (cherry picked from commit a86af67e) Co-authored-by: Andrew Svetlov --- CHANGES/3515.bugfix | 1 + aiohttp/client.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 CHANGES/3515.bugfix diff --git a/CHANGES/3515.bugfix b/CHANGES/3515.bugfix new file mode 100644 index 00000000000..99f9993eb45 --- /dev/null +++ b/CHANGES/3515.bugfix @@ -0,0 +1 @@ +Send custom per-request cookies even if session jar is empty diff --git a/aiohttp/client.py b/aiohttp/client.py index 1736ff625cf..c79823e8fbe 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -440,7 +440,7 @@ async def _request( tmp_cookie_jar = CookieJar() tmp_cookie_jar.update_cookies(cookies) req_cookies = tmp_cookie_jar.filter_cookies(url) - if session_cookies and req_cookies: + if req_cookies: session_cookies.load(req_cookies) cookies = session_cookies