1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-12-04 18:56:44 +01:00
archivr/crates
TheGeneralist 2115a70343
fix: handle __Host- cookies correctly for single-file captures
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.
2026-10-12 20:00:06 +02:00
..
archivr-cli feat: entry export (HTML / PDF / Markdown) with quiet Archivr credit 2026-10-12 19:51:15 +02:00
archivr-core fix: handle __Host- cookies correctly for single-file captures 2026-10-12 20:00:06 +02:00
archivr-server feat: entry export (HTML / PDF / Markdown) with quiet Archivr credit 2026-10-12 19:51:15 +02:00