mathiasbynens / mathiasbynens/punycode.js

wrong mapDomain split

Open
#91 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Since an email can contain multiple `@`, `mapDomain` function must find the last index of `@` to use it as the encoded chunk for the domain.

For example, this email is valid `"a@b"@c`: in that case the mail address is `"a@b"` and the domain is `c`.

Another more complex valid email:
`"very.(),:;<>[]\".VERY.\"@very@\\ \"very\".unusual"@mydomain.com`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the mapDomain function and any tests covering email-like domain parsing. Check the supplied examples, including addresses with multiple @ characters; done means the domain is derived from the final @ while the preceding address remains intact, with regression coverage for these cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.