From baa5a2f049245f6f463284ac8447587357cca8d0 Mon Sep 17 00:00:00 2001 From: Voltrex Date: Fri, 13 Aug 2021 03:20:51 +0430 Subject: [PATCH] dgram: use simplified validator The `dgram` lib module should use the simplified `validatePort()` validator. --- lib/dgram.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dgram.js b/lib/dgram.js index 4630be4dff8c5c..c515c551427d98 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -369,7 +369,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) { }; Socket.prototype.connect = function(port, address, callback) { - port = validatePort(port, 'Port', { allowZero: false }); + port = validatePort(port, 'Port', false); if (typeof address === 'function') { callback = address; address = ''; @@ -626,7 +626,7 @@ Socket.prototype.send = function(buffer, } if (!connected) - port = validatePort(port, 'Port', { allowZero: false }); + port = validatePort(port, 'Port', false); // Normalize callback so it's either a function or undefined but not anything // else.