1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-21 18:55:36 +02:00
archivr/crates/archivr-core/src
TheGeneralist e5fb6ea9bb
test(core): extract helpers and add unit tests for Codex review fixes
Extract two testable pure functions from inline_archivr_img_srcs:
- html_attr_decode: decodes HTML character references in attribute values.
  Fixes decode order: & runs LAST so < → < (one layer
  removed), not < (two layers). Previous order caused double-decoding.
- same_origin_cookie_header: returns a Cookie header value only when
  img_url's domain matches capture_url's domain.

Add 11 unit tests covering:
- html_attr_decode: plain URL no-op, &amp; in CDN query params, single-layer
  decode (&amp;lt; → &lt; not <), double-encoded amp (&amp;amp; → &amp;),
  direct &lt;/&gt;/&quot; decode
- same_origin_cookie_header: same host attaches cookies, third-party returns
  None, empty cookies returns None, Freedium empty-cookies no-op
- bounded_read: Read::take stops at max+1 bytes (guard fires), allows
  exactly-at-limit payloads (guard does not fire)
2026-07-19 15:18:16 +02:00
..
downloader test(core): extract helpers and add unit tests for Codex review fixes 2026-07-19 15:18:16 +02:00
archive.rs feat(tags): revamp tags tab (#29) 2026-07-19 11:02:57 +02:00
capture.rs fix(core): extract HTML title after font stripping, not before 2026-07-19 13:15:35 +02:00
database.rs feat(tags): revamp tags tab (#29) 2026-07-19 11:02:57 +02:00
hash.rs feat(fonts): hash_bytes, get_blob_by_sha256, font_extractor module 2026-06-25 16:02:57 +02:00
lib.rs feat: browser capture button (Track 4) 2026-06-22 22:18:44 +02:00
twitter.rs feat: add db and multi-archive web UI foundation (#8) 2026-06-14 00:27:16 +02:00