1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

TRANSIP: Fix TXT quoting (#2708)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Vincent Hagen
2023-12-11 02:47:44 +01:00
committed by GitHub
parent 8f1b33ae17
commit a7e764391c
4 changed files with 17 additions and 4 deletions

View File

@@ -19,5 +19,9 @@ func AuditRecords(records []*models.RecordConfig) []error {
a.Add("TXT", rejectif.TxtHasBackslash) // Last verified 2023-12-04
a.Add("TXT", rejectif.TxtStartsOrEndsWithSpaces) // Last verified 2023-12-10
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2023-12-10
return a.Audit(records)
}

View File

@@ -8,7 +8,6 @@ import (
"github.com/StackExchange/dnscontrol/v4/models"
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
"github.com/StackExchange/dnscontrol/v4/pkg/txtutil"
"github.com/StackExchange/dnscontrol/v4/providers"
"github.com/transip/gotransip/v6"
"github.com/transip/gotransip/v6/domain"
@@ -310,7 +309,7 @@ func recordToNative(config *models.RecordConfig, useOriginal bool) (domain.DNSEn
Name: config.Name,
Expire: int(config.TTL),
Type: config.Type,
Content: config.GetTargetCombinedFunc(txtutil.EncodeQuoted),
Content: config.GetTargetCombinedFunc(nil),
}, nil
}
@@ -322,7 +321,7 @@ func nativeToRecord(entry domain.DNSEntry, origin string) (*models.RecordConfig,
Original: entry,
}
rc.SetLabel(entry.Name, origin)
if err := rc.PopulateFromStringFunc(entry.Type, entry.Content, origin, txtutil.ParseQuoted); err != nil {
if err := rc.PopulateFromStringFunc(entry.Type, entry.Content, origin, nil); err != nil {
return nil, fmt.Errorf("unparsable record received from TransIP: %w", err)
}