Skip to main content

strip_base

Function strip_base 

Source
pub fn strip_base<'a>(path: &'a str, base: &str) -> &'a str
Expand description

Strip the site base prefix from a (already percent-decoded) request path so it can be resolved against out_dir. base must be normalized (normalize_base). A request that does not fall under base is returned unchanged — the caller then resolves it normally (and likely 404s), matching production where the host only routes in-base requests to the site.

/docs/x.css -> /x.css; /docs and /docs/ -> /; /other -> /other.