mathiasbynens / punycode.js

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891.
https://mths.be/punycode
MIT License
1.59k stars 158 forks source link

wrong mapDomain split #91

Open userquin opened 5 years ago

userquin commented 5 years ago

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