mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Lowercase punycode domain names
This commit is contained in:
parent
d2167dd290
commit
aa7323ba43
4
vendors/mathiasbynens/punycode.js
vendored
4
vendors/mathiasbynens/punycode.js
vendored
|
@ -62,7 +62,7 @@ const
|
||||||
mapDomain = (domain, callback) => {
|
mapDomain = (domain, callback) => {
|
||||||
// In email addresses, only the domain name should be punycoded.
|
// In email addresses, only the domain name should be punycoded.
|
||||||
// Leave the local part (i.e. everything up to `@`) intact.
|
// Leave the local part (i.e. everything up to `@`) intact.
|
||||||
const parts = domain.split('@');
|
const parts = (domain || '').split('@');
|
||||||
parts.push(
|
parts.push(
|
||||||
parts.pop()
|
parts.pop()
|
||||||
.split(regexSeparators)
|
.split(regexSeparators)
|
||||||
|
@ -389,7 +389,7 @@ const
|
||||||
*/
|
*/
|
||||||
toASCII: input => mapDomain(
|
toASCII: input => mapDomain(
|
||||||
input,
|
input,
|
||||||
string => regexNonASCII.test(string) ? 'xn--' + encode(string) : string
|
string => (regexNonASCII.test(string) ? 'xn--' + encode(string) : string).toLowerCase()
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue