소스 검색

fix also for host_str and domain

Johann150 5 년 전
부모
커밋
f62b0d9c77
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      url/src/lib.rs

+ 4 - 1
url/src/lib.rs

@@ -803,7 +803,8 @@ impl Url {
 
 
     /// Return the string representation of the host (domain or IP address) for this URL, if any.
     /// Return the string representation of the host (domain or IP address) for this URL, if any.
     ///
     ///
-    /// Non-ASCII domains are punycode-encoded per IDNA.
+    /// Non-ASCII domains are punycode-encoded per IDNA if this is the host
+    /// of a special URL, or percent encoded for non-special URLs.
     /// IPv6 addresses are given between `[` and `]` brackets.
     /// IPv6 addresses are given between `[` and `]` brackets.
     ///
     ///
     /// Cannot-be-a-base URLs (typical of `data:` and `mailto:`) and some `file:` URLs
     /// Cannot-be-a-base URLs (typical of `data:` and `mailto:`) and some `file:` URLs
@@ -882,6 +883,8 @@ impl Url {
     }
     }
 
 
     /// If this URL has a host and it is a domain name (not an IP address), return it.
     /// If this URL has a host and it is a domain name (not an IP address), return it.
+    /// Non-ASCII domains are punycode-encoded per IDNA if this is the host
+    /// of a special URL, or percent encoded for non-special URLs.
     ///
     ///
     /// # Examples
     /// # Examples
     ///
     ///