pub fn normalize_path(raw: &str) -> (String, bool, bool)Expand description
Normalize a URL path.
Steps:
- Percent-decode (detecting double-encoding).
- If double-encoded, decode the result a second time.
- NFKC Unicode normalization (fullwidth → ASCII, ligatures → components).
- Strip null bytes.
- Lowercase.
- Resolve
./..segments and collapse consecutive slashes.
Returns (normalized_path, double_encoding_detected, null_byte_detected).
null_byte_detected is captured PRE-strip (F-1): a decoded NUL in the path is
stripped here (so pt-null-byte, which pattern-matches the stripped output, is
structurally blind to it), but the request is forwarded RAW to the backend where
%2500-style double-encoded NULs still truncate a filename. The flag preserves the
signal for the evasion module. Path-scoped only — query/cookie/body keep their
NUL, so pt-null-byte already covers those (no double-counting).