nodemailer 6.6.4 → 6.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/shared/index.js +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/shared/index.js
CHANGED
|
@@ -13,11 +13,16 @@ const os = require('os');
|
|
|
13
13
|
const DNS_TTL = 5 * 60 * 1000;
|
|
14
14
|
|
|
15
15
|
const resolver = (family, hostname, callback) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
const networkInterfaces = os.networkInterfaces();
|
|
17
|
+
|
|
18
|
+
const familySupported =
|
|
19
|
+
// crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6
|
|
20
|
+
Object.keys(networkInterfaces)
|
|
21
|
+
.map(key => networkInterfaces[key])
|
|
22
|
+
// crux that replaces .flat() as it is not supported in older Node versions (v10 and older)
|
|
23
|
+
.reduce((acc, val) => acc.concat(val), [])
|
|
24
|
+
.filter(i => !i.internal)
|
|
25
|
+
.filter(i => i.family === 'IPv' + family).length > 0;
|
|
21
26
|
|
|
22
27
|
if (!familySupported) {
|
|
23
28
|
return callback(null, []);
|