Skip to content

Commit a5a89c5

Browse files
refactor: suggestions
1 parent 884bf6e commit a5a89c5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Server.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,10 @@ class Server {
594594
if (hostname === '0.0.0.0' || hostname === '::') {
595595
prettyHostname = 'localhost';
596596

597-
const localIP = internalIp.v4.sync();
597+
const localIP =
598+
hostname === '::' ? internalIp.v6.sync() : internalIp.v4.sync();
598599

599-
if (
600-
/^10[.]|^172[.](1[6-9]|2[0-9]|3[0-1])[.]|^192[.]168[.]/.test(localIP)
601-
) {
602-
// Address is private, format it for later use
600+
if (localIP) {
603601
lanUrlForTerminal = prettyPrintUrl(localIP);
604602
}
605603
} else {

0 commit comments

Comments
 (0)