mirror of
https://github.com/thegeneralist01/archivr
synced 2026-12-04 18:56:44 +01:00
Chrome's CDP Network.setCookies rejects __Host- prefixed cookies that
carry a domain attribute — the prefix semantically forbids domain binding.
The previous Netscape cookie file always emitted a domain column, causing
setCookies to fail with "Invalid cookie fields" and the capture to
produce no output file.
Switch single-file's cookie file to JSON format (single-file tries
JSON.parse first, falls back to Netscape text parsing). JSON gives
per-cookie field control:
- __Host- cookies: {url, path: "/", secure: true}, no domain field.
url is the https page URL (synthesised as https://hostname/ when the
page URL is non-https, since __Host- requires https anyway).
- __Secure- cookies: {domain, path: "/", secure: true}.
- All other cookies: {domain, path: "/"} — unchanged behaviour.
yt-dlp still receives the existing Netscape file; only the single-file
path is affected.
Add four unit tests covering __Host-, __Secure-, regular cookies, and
the http→https url fallback.
|
||
|---|---|---|
| .. | ||
| archivr-cli | ||
| archivr-core | ||
| archivr-server | ||