Skip to content

net: stricter checking for internal/net isLegalPort

Pull Request check-list

  • Does make -j8 test (UNIX) or vcbuild test nosign (Windows) pass with this change (including linting)?
  • Is the commit message formatted according to [CONTRIBUTING.md][0]?
  • If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Affected core subsystem(s)

net

Description of change

Please provide a description of the change here.

Add stricter testing for the isLegalPort method in internal/net. This ensures that odd inputs such as isLegalPort(true) and isLegalPort([1]) aren't acceptable as valid port inputs.

Refs: https://github.com/nodejs/node/pull/5732

Merge request reports

Loading