修复一个设置cookies的问题

This commit is contained in:
g1879 2023-11-29 17:16:31 +08:00
parent 072aad6eaf
commit 1e311e778c

View File

@ -207,7 +207,7 @@ def cookies_to_tuple(cookies):
cookies = tuple(cookie_to_dict(cookie) for cookie in cookies)
elif isinstance(cookies, str):
cookies = tuple(cookie_to_dict(cookie.lstrip()) for cookie in cookies.split(";"))
cookies = tuple(cookie_to_dict(c.lstrip()) for c in cookies.rstrip(';,').split(',' if ',' in cookies else ';'))
elif isinstance(cookies, dict):
cookies = tuple({'name': cookie, 'value': cookies[cookie]} for cookie in cookies)