ssbc / ssb-ref

check if a string is a valid ssb-reference
MIT License
14 stars 10 forks source link

parseMultiServerAddress not working with IPv4 addresses #10

Closed staltz closed 7 years ago

staltz commented 7 years ago

Why was this return added to the tests? https://github.com/ssbc/ssb-ref/blob/a2131313df34e548fcc35e8fd90347eec81f926d/test/index.js#L32

It turns off the IPv4 tests and now the line

  var host = data[0].slice(1, data[0].length - 2).join(':') //ipv6

in parseMultiServerAddress will not work for IPv4 addresses. E.g. given data[0] = ['net', '123.123.123.1', '8008'], host will be ''.

This directly affects code above in the SSB stack, for instance when generating an invite code, it will miss the host part.

dominictarr commented 7 years ago

oh oops! that was definitely unintentional! that would have been to disable the rest of the tests, so they didn't clutter the output while working on something at the start. shouldn't have been committed.

staltz commented 7 years ago

Thanks dominic