Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit 696ed92

Browse files
acidsoundjacobheun
authored andcommitted
fix: regex bug for ipv4 test (#24)
1 parent 3ba91c0 commit 696ed92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h2>This is a libp2p-websocket-star signalling-server</h2>
3939
if (f.hostname.startsWith('[') && f.hostname.endsWith(']')) f.h = f.hostname.match(/\[(.+)\]/)[1]
4040
else f.h = f.hostname
4141
f.protoport = f.port ? f.port : f.protocol == 'https:' ? 443 : 80
42-
if (f.port && ipv4Regex.test()) {
42+
if (f.port && ipv4Regex.test(f.h)) {
4343
addr += '/ip4/' + f.h + '/tcp/' + f.port + '/'
4444
} else if (f.port && ipv6Regex.test(f.h)) {
4545
addr += '/ip6/' + f.h + '/tcp/' + f.port + '/'

0 commit comments

Comments
 (0)