Fix value check for TXT over 255 chars

This commit is contained in:
William Bouzourène 2025-04-12 14:36:48 +02:00
parent b1881f90d4
commit 14dff85441
Signed by: bouzoure
SSH key fingerprint: SHA256:19MbXpLua4rUtk8tunMesD8KUKb91LXLHg8E/qTooww

View file

@ -81,8 +81,10 @@ func GetRecords(zone *Zone) error {
continue
}
record.Value = strings.TrimPrefix(record.Value, "\"")
record.Value = strings.TrimSuffix(record.Value, "\"")
if !strings.EqualFold(record.Type, "TXT") || len(record.Value) <= 255 {
record.Value = strings.TrimPrefix(record.Value, "\"")
record.Value = strings.TrimSuffix(record.Value, "\"")
}
recordsToKeep = append(recordsToKeep, record)
}