Incorrect conversion of IDNA hostname
Open
Nobody has claimed this yet.
Authority
- Dominant language
- JavaScript
- Stars
- 6.2k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
URI.js punicode support works incorrectly.
For example:
URI('http://www.Äffchen.com/').normalizeHostname().hostname() == "www.xn--ffchen-vna.com"
The correct conversion (as in browser) is following:
var a = document.createElement('a'); a.href = 'http://www.Äffchen.com/'; a.hostname == "www.xn--ffchen-9ta.com"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the normalizeHostname() and hostname() entry points, comparing URI.js's IDNA conversion with the browser result shown in the issue. Done means URI('http://www.Äffchen.com/').normalizeHostname().hostname() returns "www.xn--ffchen-9ta.com".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100