Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dgram: use simplified validator
The `dgram` lib module should use the simplified `validatePort()`
validator.
  • Loading branch information
VoltrexKeyva committed Aug 13, 2021
commit baa5a2f049245f6f463284ac8447587357cca8d0
4 changes: 2 additions & 2 deletions lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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.
Expand Down