Skip to main content

try_to_strip_path_prefix_from_uri

Function try_to_strip_path_prefix_from_uri 

pub fn try_to_strip_path_prefix_from_uri(
    uri: &Uri,
    prefix: impl AsRef<str>,
) -> Result<Uri, Box<dyn Error + Send + Sync>>
Available on crate feature http only.
Expand description

Strip prefix from the path of uri, returning a new Uri with the prefix removed (re-rooted at /). Matching is ASCII-case-insensitive, segment-boundary aware, and percent-decoded, mirroring nested-router prefix stripping.

Returns an error when the path does not start with prefix.