wrong way to trimsuffix not trimright
This commit is contained in:
@@ -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(strings.TrimRight(Zone, "."), ".")
|
||||
_segs := strings.Split(strings.TrimSuffix(Zone, "."), ".")
|
||||
_segs = _segs[len(_segs)-2:]
|
||||
return strings.Join(_segs, ".")
|
||||
}
|
||||
@@ -299,7 +299,7 @@ loop:
|
||||
if CurrRecordType == RecordType && CurrRecordAddr == Subdomain {
|
||||
if _Addr == Address {
|
||||
return CurrRecordId, nil
|
||||
} else if strings.HasSuffix(_Addr, "...") && strings.HasPrefix(Address, strings.TrimRight(_Addr, "...")) {
|
||||
} else if strings.HasSuffix(_Addr, "...") && strings.HasPrefix(Address, strings.TrimSuffix(_Addr, "...")) {
|
||||
DeepSearchCandidates = append(DeepSearchCandidates, CurrRecordId)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user