Function URL.normalize
Normalize the content of this URL
in place
void normalize
(
bool isDirectory = false
) @safe;
Normalization can be used to create a more consistent and human-friendly
string representation of the URL
.
The list of transformations applied in the process of normalization is as follows:
- Converting schema and host to lowercase
- Removing port if it is the default port for schema
- Removing dot segments in path
- Converting percent-encoded triplets to uppercase
- Adding slash when path is empty
- Adding slash to path when path represents a directory
- Decoding percent encoded triplets for unreserved characters
A-Z a-z 0-9 - . _ ~
Parameters
Name | Description |
---|---|
isDirectory | Path of the URL represents a directory, if one is
not already present, a trailing slash will be appended when
true |