(raw_cookie: Any, default_url: str = DEFAULT_COOKIE_URL)
| 277 | def _build_cookie_merge_key(cookie: Dict[str, Any], default_url: str) -> Optional[str]: |
| 278 | name = str(cookie.get("name") or "").strip() |
| 279 | if not name: |
| 280 | return None |
| 281 | domain = str(cookie.get("domain") or "").strip().lower() |
| 282 | url = str(cookie.get("url") or "").strip() |
| 283 | path = str(cookie.get("path") or "/").strip() or "/" |
| 284 | if not domain: |
| 285 | candidate_url = url or default_url |
| 286 | try: |
| 287 | parsed = urlparse(candidate_url) |
| 288 | domain = str(parsed.hostname or "").strip().lower() |
| 289 | except Exception: |
| 290 | domain = "" |
| 291 | return json.dumps([name, domain, path], ensure_ascii=True, separators=(",", ":")) |
| 292 | |
| 293 | |
| 294 | def merge_browser_cookie_payloads( |
| 295 | base_cookie: Any, |
nothing calls this directly
no test coverage detected