Skip to main content

normalize_path

Function normalize_path 

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

Normalize an HTTP path to prevent ACL bypasses via encoding tricks.

  • Decodes percent-encoded characters (e.g. %2F/, %61a)
  • Collapses duplicate slashes (///)
  • Resolves . and .. segments
  • Ensures the path starts with /