Trim '.' per specification

This commit is contained in:
2022-03-14 07:09:50 +09:00
parent fb99ace026
commit 131d3b2387
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ const URI_DELETE_RECORD = "https://freedns.afraid.org/subdomain/delete2.php?data
// const URI_LOGIN string = "http://127.0.0.1:1234/"
func GetDomainFromZone(Zone string) string {
_segs := strings.Split(Zone, ".")
_segs := strings.Split(strings.TrimRight(Zone, "."), ".")
_segs = _segs[len(_segs)-2:]
return strings.Join(_segs, ".")
}