From a86af67e92597ee3d0d5bb546531d35d23420d39 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 10 Jan 2019 14:00:34 +0200 Subject: [PATCH] Send custom per-request cookies even if session jar is empty (#3515) * Send custom per-request cookies even if session jar is empty * Add changenote --- 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 163bb107e45..3991cae6ae0 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -430,7 +430,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