Skip to content

Commit

Permalink
Remove null values when transfer session to driver
Browse files Browse the repository at this point in the history
Fixes #41
  • Loading branch information
jschnurr authored and lordjabez committed Apr 17, 2022
1 parent 4742f8f commit 0a52b95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions requestium/requestium.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ def transfer_session_cookies_to_driver(self, domain=None):

# Transfer cookies
for c in [c for c in self.cookies if domain in c.domain]:
self.driver.ensure_add_cookie({'name': c.name, 'value': c.value, 'path': c.path,
'expiry': c.expires, 'domain': c.domain})
cookie = {'name': c.name, 'value': c.value, 'path': c.path,
'expiry': c.expires, 'domain': c.domain}

self.driver.ensure_add_cookie({k: v for k, v in cookie.items() if v is not None})

def transfer_driver_cookies_to_session(self, copy_user_agent=True):
if copy_user_agent:
Expand Down

0 comments on commit 0a52b95

Please sign in to comment.