Skip to content

Commit dec3bb8

Browse files
outsiderisdiemol
andauthored
[JS] handle a breaking changes in os.networkInterfaces (#10611)
In Node 18+, os.networkInterface's family is either 4 or 6, os.networkInterface's family was either IPv4 or IPv6 until Node 16 Signed-off-by: Outsider <outsideris@gmail.com> Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
1 parent fe84ca7 commit dec3bb8

File tree

1 file changed

+1
-1
lines changed
  • javascript/node/selenium-webdriver/net

1 file changed

+1
-1
lines changed

‎javascript/node/selenium-webdriver/net/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function getIPAddress(loopback, family) {
4848
}
4949

5050
for (let ipAddress of interfaces[key]) {
51-
if (ipAddress.family === family && ipAddress.internal === loopback) {
51+
if ((ipAddress.family === family || `IPv${ipAddress.family}` === family) && ipAddress.internal === loopback) {
5252
return ipAddress.address
5353
}
5454
}

0 commit comments

Comments
 (0)