Skip to content

NormalizeURI

[Source]

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.

primitive val NormalizeURI

Constructors

create

[Source]

new val create()
: NormalizeURI val^

Returns


Public Functions

apply

[Source]

fun box apply(
  uri: URI val)
: (URI val | InvalidPercentEncoding val)

Parameters

Returns


eq

[Source]

fun box eq(
  that: NormalizeURI val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: NormalizeURI val)
: Bool val

Parameters

Returns