mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
避免cookie中某个值是空时出现的问题
This commit is contained in:
parent
25c59cf950
commit
b8a82d6bfc
@ -739,10 +739,11 @@ def _cookie_to_dict(cookie: Union[Cookie, str, dict]) -> dict:
|
||||
attr_val = attr.lstrip().split('=')
|
||||
|
||||
if key == 0:
|
||||
# TODO: 检查
|
||||
cookie_dict['name'] = attr_val[0]
|
||||
cookie_dict['value'] = attr_val[1]
|
||||
cookie_dict['value'] = attr_val[1] if len(attr_val) == 2 else ''
|
||||
else:
|
||||
cookie_dict[attr_val[0]] = attr_val[1]
|
||||
cookie_dict[attr_val[0]] = attr_val[1] if len(attr_val) == 2 else ''
|
||||
|
||||
return cookie_dict
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user