Skip to content

Commit f62b0d9

Browse files
committed
fix also for host_str and domain
1 parent 0ed8efd commit f62b0d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

url/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,8 @@ impl Url {
803803

804804
/// Return the string representation of the host (domain or IP address) for this URL, if any.
805805
///
806-
/// Non-ASCII domains are punycode-encoded per IDNA.
806+
/// Non-ASCII domains are punycode-encoded per IDNA if this is the host
807+
/// of a special URL, or percent encoded for non-special URLs.
807808
/// IPv6 addresses are given between `[` and `]` brackets.
808809
///
809810
/// Cannot-be-a-base URLs (typical of `data:` and `mailto:`) and some `file:` URLs
@@ -882,6 +883,8 @@ impl Url {
882883
}
883884

884885
/// If this URL has a host and it is a domain name (not an IP address), return it.
886+
/// Non-ASCII domains are punycode-encoded per IDNA if this is the host
887+
/// of a special URL, or percent encoded for non-special URLs.
885888
///
886889
/// # Examples
887890
///

0 commit comments

Comments
 (0)