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

Commit

Permalink
fix: regex bug for ipv4 test (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
acidsound authored and jacobheun committed Oct 23, 2018
1 parent 3ba91c0 commit 696ed92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2>This is a libp2p-websocket-star signalling-server</h2>
if (f.hostname.startsWith('[') && f.hostname.endsWith(']')) f.h = f.hostname.match(/\[(.+)\]/)[1]
else f.h = f.hostname
f.protoport = f.port ? f.port : f.protocol == 'https:' ? 443 : 80
if (f.port && ipv4Regex.test()) {
if (f.port && ipv4Regex.test(f.h)) {
addr += '/ip4/' + f.h + '/tcp/' + f.port + '/'
} else if (f.port && ipv6Regex.test(f.h)) {
addr += '/ip6/' + f.h + '/tcp/' + f.port + '/'
Expand Down

0 comments on commit 696ed92

Please sign in to comment.