Skip to main content

under_any_root

Function under_any_root 

Source
fn under_any_root(document_roots: &[PathBuf], resolved: &Path) -> bool
Expand description

Whether resolved sits under one of the document roots. The comparison is by path component - Path::starts_with - so MadnessX is not under a Madness root.

The root is compared both as it resolves and as it was written: a MISSING path falls back to a lexical walk built from the request’s own spelling, so a root reached through a symlink would otherwise refuse a missing document as an escape that its in-tree twin reports missing. The spelled arm can only ever match a path that is not on disk, which is what keeps it from admitting an escape.