Skip to main content

normalize_url_path_for_storage

Function normalize_url_path_for_storage 

Source
pub(crate) fn normalize_url_path_for_storage(url_path: &str) -> String
Expand description

Canonical storage/lookup form: decode %xx, then per /-segment turn whitespace into -, strip the unsafe ASCII in URL_PATH_ENCODE_SET, and collapse/trim dashes. Case, non-ASCII and /, -, ., _, ~ are kept. Unsafe chars are removed, not %xx-encoded, so every save funnels through here and paths can’t re-accumulate escapes. Mirrors clean_url_path (page migration) and the frontend cleanUrlPath; keep the three in agreement.