Expand description
Hostname and URL matching utilities.
These helpers provide reusable matching rules that the URL parser does not expose directly.
Re-exportsΒ§
use std::borrow::Cow;πuse std::fmt;πuse std::fmt::Display;πuse std::fmt::Write;πuse http::Uri;πuse url::Host;πuse url::Url;πuse url::form_urlencoded::Serializer;πuse super::string::is_unreserved_byte;π
StructsΒ§
- Sanitized
Uri - Formats a request URI without exposing sensitive components.
FunctionsΒ§
- has_
dot_ segment - Whether a URL path holds a
.or..segment once percent-decoded. - hostname_
matches_ domain - Reports whether a hostname is equal to or beneath a domain name.
- is_
dot_ πsegment - is_
loopback - Whether a URLβs host names the loopback interface.
- is_
path_ byte - Whether a byte may appear unencoded in a URL path (RFC 3986).
- is_
plain_ path - Whether a raw URL path survives URL parsing as written.
- redirect_
allowlisted - Whether a URIβs host, or its scheme when it has no host, appears in
allowed. - strip_
dot π - strip_
trailing_ slash - Drops one trailing slash, if present.
- url_
encode - Percent-encodes a string for use in a URL component.
- with_
query - Appends form-encoded query pairs to a path.