1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-21 18:55:36 +02:00
archivr/crates
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
..
archivr-cli feat: add user-configurable cookie rules (#20) 2026-07-06 19:01:34 +02:00
archivr-core test(core): extract helpers and add unit tests for Codex review fixes 2026-07-19 15:18:16 +02:00
archivr-server feat(frontend): add Freedium mirror toggle to capture advanced options 2026-07-19 12:09:42 +02:00