Commit 27407fc
committed
feat: improved authority validation checks
Rewrites the `http::uri::Authority` validation to follow RFC 3986 more
strictly, rejecting a illegal authorities that are currently accepted
(such as broken IPv6 literals or non-digit ports).
All validation code is written such that it can execute in a `const`
context, to maintain support for `Authority::from_static`.
At the same time, this allows the host to be percent-encoded. Allowed
percent encodings are restricted to characters that can't be encoded
as-is to prevent url-confusion attacks with authorities that the crate
currently accepts. That is, authorities that are semantically equivalent
to a previously acccepted one but compare differently due to the use of
percent encodings will be rejected.1 parent 4d18d3e commit 27407fc
1 file changed
Lines changed: 471 additions & 83 deletions
0 commit comments