1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00
This commit is contained in:
Tom Limoncelli
2023-11-18 14:32:00 -05:00
parent 326a2566e2
commit fa097b498d
2 changed files with 5 additions and 2 deletions

View File

@ -69,6 +69,10 @@ func (rc *RecordConfig) GetTargetTXTSegmentCount() int {
} }
func splitChunks(buf string, lim int) []string { func splitChunks(buf string, lim int) []string {
if len(buf) == 0 {
return nil
}
var chunk string var chunk string
chunks := make([]string, 0, len(buf)/lim+1) chunks := make([]string, 0, len(buf)/lim+1)
for len(buf) >= lim { for len(buf) >= lim {

View File

@ -521,8 +521,7 @@ func (a *azurednsProvider) recordToNativeDiff2(recordKey models.RecordKey, recor
if recordSet.Properties.TxtRecords == nil { if recordSet.Properties.TxtRecords == nil {
recordSet.Properties.TxtRecords = []*adns.TxtRecord{} recordSet.Properties.TxtRecords = []*adns.TxtRecord{}
} }
// Empty TXT record needs to have no value set in it's properties if rec.GetTargetTXTJoined() != "" { // Empty TXT record needs to have no value set in it's properties
if !(rec.GetTargetTXTSegmentCount() == 1 && rec.GetTargetTXTSegmented()[0] == "") {
var txts []*string var txts []*string
for _, txt := range rec.GetTargetTXTSegmented() { for _, txt := range rec.GetTargetTXTSegmented() {
txts = append(txts, to.StringPtr(txt)) txts = append(txts, to.StringPtr(txt))