Skip to main content

is_safe_path

Function is_safe_path 

Source
pub fn is_safe_path(base: impl AsRef<Path>, target: impl AsRef<Path>) -> bool
Expand description

Reject paths that escape the base directory, including via symlinks.

Ported from @hyperframes/core/src/safePath.ts.