Expand description
Percent-decoding and canonicalisation for URL path segments. Percent-decoding for URL path segments.
Deliberately separate from the query-string decoder in crate::call. Two
differences matter, and both are defects if carried over:
+is a literal plus in a path. Onlyapplication/x-www-form-urlencodedquery strings treat it as a space.- Invalid UTF-8 is an error, not
U+FFFD. Replacement characters collapse distinct byte sequences into the same string, which is unsound input to a path-safety decision.
Callers must split on / before decoding. Decoding first would let
%2F manufacture separators and forge extra path segments.
Enums§
- Path
Policy - What to do when a request path is a non-canonical spelling of a route.
Functions§
- canonical_
path - The canonical spelling of
path, orNoneif it is already canonical.