mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Copy cookie policy when copying a CookieJar
Without it, the cookie policy would get lost while making a request. That would be invisible to the user if the default cookie policy wasn't changed, of course.
This commit is contained in:
committed by
Nate Prewitt
parent
d1aeb7ea8c
commit
3ef49272f2
@@ -415,6 +415,7 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
|
||||
def copy(self):
|
||||
"""Return a copy of this RequestsCookieJar."""
|
||||
new_cj = RequestsCookieJar()
|
||||
new_cj.set_policy(self._policy)
|
||||
new_cj.update(self)
|
||||
return new_cj
|
||||
|
||||
|
||||
Reference in New Issue
Block a user