mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-28 03:57:57 -06:00
The fetch crate is about to serve downloads whose file names, sizes and addresses come from a user-editable list, so it checks them before touching the disk: an ordinary, unique file name (no separators, drive or stream syntax, control characters, trailing dots, Windows device names or .part suffix), a non-zero size within the caller's bound, a well-formed SHA-256, bounded file, mirror and attempt counts, and URLs capped at 16 KiB. FileSpec now borrows its strings (callers with static names are unchanged) so a name read from a file needs no leaking. download_url fetches one file from an exact address, query string included, for signed links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>