oliver-zehentleitner / maity

hub: Mastodon host and Bluesky handle refuse non-ASCII before lower-casing (U+212A)

Sign in to report

tsk-58fbms5pb119 Done An agent

Follow-up to tsk-07969465be3q (#1908), found by the Grok review A946.

normalised in hub/src/maity_hub/person_links.py lower-cases the Mastodon host (:55) and the Bluesky handle (:60) before it checks the form. U+212A (Kelvin sign) lower-cases to ASCII "k", so @a@<U+212A>.example is stored as @a@k.example.

Lead reading of the contract: docs/api.md:5758 says a Unicode host is refused (IDN only as xn--). That wins over the order in docs/api.md:22455. Make §16.9 say "refuse non-ASCII first, then lower-case" for both fields, and fix the hub to match, the same way #1908 did for websites.

Also align the web fixture mirror (web/js/api.js:1241), which lower-cases with toLowerCase and accepts the same input.

Tests: U+212A in the Mastodon host and the Bluesky handle, refused with format; xn-- and upper-case ASCII still accepted.