diff --git a/lib/internal/net.js b/lib/internal/net.js index 80de67791512e4..d4d06dd5d22e21 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -94,7 +94,9 @@ function isLoopback(host) { hostLower === 'localhost' || hostLower.startsWith('127.') || hostLower === '[::1]' || - hostLower === '[0:0:0:0:0:0:0:1]' + hostLower === '::1' || + hostLower === '[0:0:0:0:0:0:0:1]' || + hostLower === '0:0:0:0:0:0:0:1' ); } diff --git a/test/parallel/test-internal-net-isLoopback.js b/test/parallel/test-internal-net-isLoopback.js index df63bfc262eaf6..ab3105bac3d24a 100644 --- a/test/parallel/test-internal-net-isLoopback.js +++ b/test/parallel/test-internal-net-isLoopback.js @@ -10,7 +10,9 @@ const loopback = [ '127.0.0.255', '127.1.2.3', '[::1]', + '::1', '[0:0:0:0:0:0:0:1]', + '0:0:0:0:0:0:0:1', ]; const loopbackNot = [