NormalizeURI¶
Normalize a URI per RFC 3986 sections 6.2.2 (syntax-based) and 6.2.3 (scheme-based).
Syntax-based normalization (always safe, uses only generic URI syntax):
- Case normalization: scheme and host are lowercased.
- Percent-encoding normalization: hex digits in %XX are uppercased;
percent-encoded unreserved characters are decoded to their literal form.
- Dot-segment removal: . and .. segments are resolved in the path.
Scheme-based normalization (requires scheme-specific knowledge):
- Default port removal: ports matching the scheme's well-known default
(http→80, https→443, ftp→21) are removed.
- Empty path normalization: for http and https, an empty path with
an authority is set to "/" (per RFC 7230).
Returns InvalidPercentEncoding if any component contains a malformed
percent-encoded sequence, since ParseURI does not validate
percent-encoding within components.
Constructors¶
create¶
Returns¶
- NormalizeURI val^
Public Functions¶
apply¶
Parameters¶
- uri: URI val
Returns¶
- (URI val | InvalidPercentEncoding val)
eq¶
Parameters¶
- that: NormalizeURI val
Returns¶
- Bool val
ne¶
Parameters¶
- that: NormalizeURI val
Returns¶
- Bool val