Skip to main content

Module url

Module url 

Source
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Β§

SanitizedUri
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.