mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CLOUDFLAREAPI: Fix TXT records with quotes
This commit is contained in:
@@ -42,6 +42,7 @@ func (rc *RecordConfig) PopulateFromString(rtype, contents, origin string) error
|
|||||||
case "SOA":
|
case "SOA":
|
||||||
return rc.SetTargetSOAString(contents)
|
return rc.SetTargetSOAString(contents)
|
||||||
case "SPF", "TXT":
|
case "SPF", "TXT":
|
||||||
|
fmt.Printf("DEBUG: popFrmStr txt=%q\n", contents)
|
||||||
return rc.SetTargetTXTString(contents)
|
return rc.SetTargetTXTString(contents)
|
||||||
case "SRV":
|
case "SRV":
|
||||||
return rc.SetTargetSRVString(contents)
|
return rc.SetTargetSRVString(contents)
|
||||||
|
@@ -119,7 +119,7 @@ func (c *cloudflareProvider) createRec(rec *models.RecordConfig, domainID string
|
|||||||
prio = fmt.Sprintf(" %d ", rec.MxPreference)
|
prio = fmt.Sprintf(" %d ", rec.MxPreference)
|
||||||
}
|
}
|
||||||
if rec.Type == "TXT" {
|
if rec.Type == "TXT" {
|
||||||
content = rec.GetTargetField()
|
content = rec.GetTargetTXTrfc1035()
|
||||||
}
|
}
|
||||||
if rec.Type == "DS" {
|
if rec.Type == "DS" {
|
||||||
content = fmt.Sprintf("%d %d %d %s", rec.DsKeyTag, rec.DsAlgorithm, rec.DsDigestType, rec.DsDigest)
|
content = fmt.Sprintf("%d %d %d %s", rec.DsKeyTag, rec.DsAlgorithm, rec.DsDigestType, rec.DsDigest)
|
||||||
@@ -183,9 +183,8 @@ func (c *cloudflareProvider) modifyRecord(domainID, recID string, proxied bool,
|
|||||||
TTL: int(rec.TTL),
|
TTL: int(rec.TTL),
|
||||||
}
|
}
|
||||||
if rec.Type == "TXT" {
|
if rec.Type == "TXT" {
|
||||||
if len(rec.TxtStrings) > 1 {
|
r.Content = rec.GetTargetTXTrfc1035()
|
||||||
r.Content = `"` + strings.Join(rec.TxtStrings, `" "`) + `"`
|
fmt.Printf("DEBUG: modifyRecord TXT content = %q\n", r.Content)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if rec.Type == "SRV" {
|
if rec.Type == "SRV" {
|
||||||
r.Data = cfSrvData(rec)
|
r.Data = cfSrvData(rec)
|
||||||
|
Reference in New Issue
Block a user