Skip to content

Commit

Permalink
Merge pull request #258 from systemcrash/bracketfix
Browse files Browse the repository at this point in the history
Avoid wrapping IPv6 in []
  • Loading branch information
adubovikov authored Jun 8, 2020
2 parents 359446c + 05c68e7 commit c0b6af9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export class TabFlowComponent implements OnInit, AfterViewInit, OnDestroy {
const regex = RegExp('(.*(?!$))(?::)([0-9]+)?$');
if(regex.exec(i) != null){
var IP = regex.exec(i)[1] // gives IP
if(IP.indexOf(':') > 0 ) {
//got an IPv6
if(IP.indexOf(':') > 0 && IP.indexOf(']') == -1 ) {
//got an IPv6, not already wrapped in brackets '[ipv6]'
//pre+suffix [ IPv6 ] to make addr:port delineation clearer
IP = '[' + IP + ']'
}
Expand Down

0 comments on commit c0b6af9

Please sign in to comment.