lni/dragonboat

Improve the address validator

Opened this issue · 1 comments

lni commented

All addresses used in the config are locally validated, the current implementation relies on a few regex to do that, code is here. See IsValidAddress() and IsValidAddressErr().

Current limitation is that it can't tell that things like 192.168.0.300 is invalid (see the 300 part), as they are considered as a valid hostname (not an IPv4 address).

It will great if someone can help to improve the address validator and provide a few tests.

hi @lni.

I would like to get feedback from you about PR.

Thanks