fix: dns lookup fail with IP with zeros padding (#237)
This commit is contained in:
committed by
GitHub
parent
78de22f518
commit
bffcc35299
@@ -9,7 +9,7 @@ module.exports = {
|
||||
const rawConnection = _.get(command, 'arg', '').split(',');
|
||||
if (rawConnection.length !== 6) return this.reply(425);
|
||||
|
||||
const ip = rawConnection.slice(0, 4).join('.');
|
||||
const ip = rawConnection.slice(0, 4).map((b) => parseInt(b)).join('.');
|
||||
const portBytes = rawConnection.slice(4).map((p) => parseInt(p));
|
||||
const port = portBytes[0] * 256 + portBytes[1];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user