mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
net: use missing validator
The `net` lib module's `lookupAndConnect()` function is missing a validator. PR-URL: https://github.com/nodejs/node/pull/38984 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
This commit is contained in:
@@ -102,6 +102,7 @@ const {
|
||||
const { isUint8Array } = require('internal/util/types');
|
||||
const {
|
||||
validateAbortSignal,
|
||||
validateFunction,
|
||||
validateInt32,
|
||||
validateNumber,
|
||||
validatePort,
|
||||
@@ -1002,10 +1003,8 @@ function lookupAndConnect(self, options) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.lookup && typeof options.lookup !== 'function')
|
||||
throw new ERR_INVALID_ARG_TYPE('options.lookup',
|
||||
'Function', options.lookup);
|
||||
|
||||
if (options.lookup !== undefined)
|
||||
validateFunction(options.lookup, 'options.lookup');
|
||||
|
||||
if (dns === undefined) dns = require('dns');
|
||||
const dnsopts = {
|
||||
|
||||
Reference in New Issue
Block a user