Skip to main content

normalize_path

Function normalize_path 

Source
pub fn normalize_path(path: &str) -> Option<String>
Expand description

Collapse . and .. segments and reject anything that escapes the root.

Used before serving files from disk so a request cannot walk out of the public directory.