- From: Uku Sõrmus <notifications@github.com>
- Date: Mon, 21 Apr 2025 11:41:19 -0700
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/url/issues/871@github.com>
ukusormus created an issue (whatwg/url#871) ### What is the issue with the URL Standard? 1. Is there any reason to continue allowing consecutive dots in a domain, at all? ```js new URL("https://a...b..c...d./").hostname // "a...b..c...d." ``` 2. Should 2.1) consecutive dots 2.2) a trailing dot be allowed under "Host writing" (`beStrict = true` => `VerifyDnsLength = true`), as per UTS46: ```js u = new URL("https://example.com/") u.host = "a...b..c...d." u.host // "a...b..c...d." ``` <https://www.unicode.org/reports/tr46/#ToASCII>: ``` Break the result into labels at U+002E FULL STOP. ... If the VerifyDnsLength flag is true, then verify DNS length restrictions. ... The length of each label is from 1 to 63 ... When VerifyDnsLength is true, the empty root label is disallowed. ``` Last two sentences seem violated from the above URL API example - there *are* empty labels, including root label. Snips of relevant sections as of [current commit](https://github.com/whatwg/url/commit/cc8b776b89a6d92b5cc74581c8d90450d3c1e762): ``` 3.3. IDNA The domain to ASCII algorithm, given a string domain and a boolean beStrict, runs these steps: 1. Let result be the result of running Unicode ToASCII with [...] VerifyDnsLength set to beStrict [...]. [UTS46] Note: If beStrict is false, domain is an ASCII string, and strictly splitting domain on U+002E (.) does not produce any item that starts with an ASCII case-insensitive match for "xn--", this step is equivalent to ASCII lowercasing domain. 3.4. Host writing ... A string input is a valid domain if these steps return true: 1. Let domain be the result of running domain to ASCII with input and true. 3.5. Host parsing ... 5. Let asciiDomain be the result of running domain to ASCII with domain and false. ``` (under host writing, `beStrict = true`, but under parsing, `beStrict = false`) --- From [PSL definitions section](https://github.com/publicsuffix/list/wiki/Format#definitions): "Empty labels are not permitted." ```sh $ dig a..b dig: 'a..b' is not a legal name (empty label) ``` May be relevant reply from another issue from another person: <https://github.com/whatwg/url/issues/245#issuecomment-2662868049> -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/871 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/url/issues/871@github.com>
Received on Monday, 21 April 2025 18:41:24 UTC