Skip to content

Commit 7024eac

Browse files
authored
Merge PR #67: 修复扫码登录验证 Cookie 格式
2 parents b2f4971 + 3c502b8 commit 7024eac

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

tests/test_qr_login.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import unittest
2+
3+
from utils.qr_login import QRLoginManager
4+
5+
6+
class QRLoginCookieTests(unittest.TestCase):
7+
def test_browser_cookies_use_playwright_url_shape(self):
8+
manager = QRLoginManager()
9+
10+
cookies = manager._build_browser_cookies(
11+
"https://passport.goofish.com/iv/remote/pc/mini_login_check.htm",
12+
{"foo": "bar"},
13+
)
14+
15+
self.assertEqual(cookies[0]["url"], "https://passport.goofish.com")
16+
self.assertNotIn("path", cookies[0])
17+
18+
19+
if __name__ == "__main__":
20+
unittest.main()

utils/qr_login.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def _build_browser_cookies(self, target_url: str, cookies: Dict[str, str]) -> li
118118
'name': name,
119119
'value': str(value),
120120
'url': target_origin,
121-
'path': '/',
122121
})
123122

124123
return browser_cookies

0 commit comments

Comments
 (0)