~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

A site's file is named in UTF-8, and a refused path says why

Merged
Merged chadtmiller.com asked to merge into feature/pages from chadtmiller.com/knotless:pages/paths

What changes

knotless site refuses a file whose name is not UTF-8, naming it. It used to read such a name lossily. A path it refuses is now said to break any of the rules for a site's path, not only its length.

Why

These are two notes from the review of knotless site deploys a directory as a repository's website:

  • walk read names with to_string_lossy, so two names that are not UTF-8 could become the same path. A site's record needs each path to be distinct.
  • The refusal always said the path was too long, though valid_path also refuses empty, . and .. parts.

A third note, that the printed address trusts the handle in the URL, is left as it is: the address is only printed.

How it was checked

A unit test names a file a\xff.html and checks walk refuses it. It runs on Linux alone, as macOS's filesystems refuse such names. The CLI's sites test reads the new wording. CI runs both.

Changeset: none

🤖 Generated with Claude Code

Approved

This makes walk refuse a file name that isn't UTF-8, using into_string instead of to_string_lossy. That closes the case where two non-UTF-8 names collapse into one path. It also changes the deploy refusal message so it covers every valid_path rule, not only length. The change is small and correct. tempfile is already a dependency, the test is gated to Linux, and the CLI test string was updated to match the new wording. I found nothing to change.

Approved

This is still the same small change. walk now refuses a file name that isn't UTF-8, using into_string and naming the path. The deploy refusal now lists every valid_path rule. The Linux-only test and the updated CLI test string match the new wording. The only difference since my last approval is the doc comment on walk. I found nothing to change.

Merged as 157049d