[whatwg/url] Double-encoded IDNA labels don't roundtrip (#603)

Consider `xn--xn---epa`. It appears that using the current **domain to Unicode** algorithm (as implemented by Node.js), this would get converted to `xn--é`. But applying **domain to ASCII** on `xn--é` would produce a Punycode decoding failure. It sounds like domain to Unicode (or even UTS 46) should return failure on such labels.

This is somewhat important because Firefox can create such double-encoded labels:

```js
» new URL('http://xn--').hostname
❮ "xn--xn---epa"
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/603

Received on Monday, 17 May 2021 19:01:35 UTC