Skip to content

Commit

Permalink
Copy cookie policy when copying a CookieJar
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laurentb authored and nateprewitt committed Jun 12, 2018
1 parent d1aeb7e commit 3ef4927
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions requests/cookies.py
Expand Up @@ -415,6 +415,7 @@ def __setstate__(self, state):
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

Expand Down

0 comments on commit 3ef4927

Please sign in to comment.