File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1+ from http .cookiejar import MozillaCookieJar
12from urllib .parse import urlparse
23from threading import Lock
34from typing import Callable , Any
@@ -45,7 +46,13 @@ def get(self, url: str) -> Session:
4546 self .sessions [key ].headers .update (default_header )
4647 if self .default_jar :
4748 # FIXME: do we have to check cookies' domain?
48- self .sessions [key ].cookies .update (self .default_jar )
49+ # FIXME: we have to filter with domain since curl_cffi doesn't check them
50+ session_cookies = self .default_jar .get_cookies_for_url (url )
51+ session_jar = MozillaCookieJar ()
52+ for cookie in session_cookies :
53+ session_jar .set_cookie (cookie )
54+ # breakpoint()
55+ self .sessions [key ].cookies .update (session_jar )
4956
5057 return self .sessions [key ]
5158
You can’t perform that action at this time.
0 commit comments