Open dfawley opened 2 months ago
Per RFC 3986, a valid URI may contain an empty authority (via an empty reg-name). However, it does not parse correctly by the Uri type:
reg-name
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=54db213feefae8e5b47294b4fcdbdad7
[src/main.rs:6:5] "file:///a/b/c".parse::<Uri>() = Err( InvalidUri( InvalidFormat, ),
Similarly, from_parts complains specifically that the authority is missing:
from_parts
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0d31ed893d7f6cb8b37df6353eecfe8a
[src/main.rs:11:5] Uri::from_parts(parts) = Err( InvalidUriParts( InvalidUri( AuthorityMissing, ), ),
I could look into a change here, but note this fix would also be a breaking behavior change, and if any users are intentionally using this to enforce a non-empty authority, then they would be impacted.
cc @seanmonstar @LucioFranco - thanks!
Per RFC 3986, a valid URI may contain an empty authority (via an empty
reg-name
). However, it does not parse correctly by the Uri type:https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=54db213feefae8e5b47294b4fcdbdad7
Similarly,
from_parts
complains specifically that the authority is missing:https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=0d31ed893d7f6cb8b37df6353eecfe8a
I could look into a change here, but note this fix would also be a breaking behavior change, and if any users are intentionally using this to enforce a non-empty authority, then they would be impacted.
cc @seanmonstar @LucioFranco - thanks!