mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-04 07:02:45 +08:00
updated normalize method
This commit is contained in:
parent
0d3ed29ebf
commit
d12c453937
1 changed files with 7 additions and 1 deletions
|
@ -65,7 +65,13 @@ function normalizeAddress(address, withNames) {
|
|||
.trim();
|
||||
let encodedDomain = domain;
|
||||
try {
|
||||
encodedDomain = punycode.toUnicode(domain);
|
||||
if (/^xn--/.test(domain)) {
|
||||
encodedDomain = punycode
|
||||
.toUnicode(domain)
|
||||
.normalize('NFC')
|
||||
.toLowerCase()
|
||||
.trim();
|
||||
}
|
||||
} catch (E) {
|
||||
// ignore
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue