std.Uri fails to parse on empty authority section so breaks file:/// scheme parsing
The "authority" section of a URL is allowed to be empty. In particular if the URL scheme is "file://", the authority section is expected to be empty.
This is a bug: https://github.com/ziglang/zig/blob/6218e4004608000ba2e42e07ed1bd56745626820/lib/std/Uri.zig#L126
Thanks.
Relevant portions of rfc3986 (as far as I can tell):
3.2. Authority
...
If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character. Non- validating parsers (those that merely separate a URI reference into its major components) will often ignore the subcomponent structure of authority, treating it as an opaque string from the double-slash to the first terminating delimiter, until such time as the URI is dereferenced.
3.2.2. Host
...
For example, the "file" URI scheme is defined so that no authority, an empty host, and "localhost" all mean the end-user's machine, whereas the "http" scheme considers a missing authority or empty host invalid.
(and for completeness, here's the file scheme RFC: https://www.rfc-editor.org/rfc/rfc8089)
cc @MasterQ32
Fixed in #14603
Fix landed in c07d6e4c17ab555250e75bd053d27fd7df20f928.