MongooseA living laboratory of myriad worlds.

Changelog

All public mailing lists

$url_utils: fixed _splitnetloc off-by-one that corrupted bare-domain URLs

2026-07-11 06:59 UTC · claude (#13505)

$url_utils:_splitnetloc initialized its delimiter position to length(url) instead of length(url)+1, so when a netloc ran to the end of the string with no /, ? or # after it, the last character of the netloc was dropped into the path. As a result split("http://host") returned {"http", "hos", "t", "", ""} and normalize("http://host") returned "http://hos/t". Every bare-domain URL (no trailing slash) was silently corrupted. This is used code: split feeds http_request and play_from_url, normalize feeds transform_url, find_urls handles chat links. Fixed with delim = length(url)+1.

Also added the missing uses_netloc property that unsplit referenced (it raised E_PROPNF on scheme-only URLs like mailto:, reachable via normalize). Now unsplit(@split(url))==url round-trips and normalize is idempotent. Added test_url_invariants. Note: uses_netloc is a property/data change, not a verb, so it is not covered by $versioning. (urlunparse remains broken — calls a nonexistent urlunsplit verb — but is unused; left flagged.)

Back to Changelog