1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-11-04 09:22:29 +01:00

copy_session() now also copies session.headers

Store a shallow copy of the headers rather than just create bindings
between the headers of the original and the newly created session object.
This commit is contained in:
André Koch-Kramer 2017-07-29 01:54:42 +02:00
parent 99620ec766
commit 3e0b81ad56

View File

@ -103,7 +103,7 @@ def copy_session(session: requests.Session) -> requests.Session:
new = requests.Session() new = requests.Session()
new.cookies = \ new.cookies = \
requests.utils.cookiejar_from_dict(requests.utils.dict_from_cookiejar(session.cookies)) requests.utils.cookiejar_from_dict(requests.utils.dict_from_cookiejar(session.cookies))
new.headers = session.headers new.headers = session.headers.copy()
return new return new