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

CLOUDFLAREAPI: Support TXTMulti and empty TXT targets (#978)

* CLOUDFLAREAPI: Add TXTMulti support

* CLOUDFLAREAPI: Support TXTMulti and empty TXT strings
This commit is contained in:
Tom Limoncelli
2020-11-29 14:39:15 -05:00
committed by GitHub
parent 12a3354c0c
commit 096458d91c
3 changed files with 12 additions and 1 deletions

View File

@@ -194,6 +194,11 @@ func (c *cloudflareProvider) createRec(rec *models.RecordConfig, domainID string
if rec.Type == "MX" {
prio = fmt.Sprintf(" %d ", rec.MxPreference)
}
if rec.Type == "TXT" {
if len(rec.TxtStrings) > 1 {
content = `"` + strings.Join(rec.TxtStrings, `" "`) + `"`
}
}
if rec.Type == "DS" {
content = fmt.Sprintf("%d %d %d %s", rec.DsKeyTag, rec.DsAlgorithm, rec.DsDigestType, rec.DsDigest)
}
@@ -272,6 +277,11 @@ func (c *cloudflareProvider) modifyRecord(domainID, recID string, proxied bool,
TTL: rec.TTL,
Data: nil,
}
if rec.Type == "TXT" {
if len(rec.TxtStrings) > 1 {
r.Content = `"` + strings.Join(rec.TxtStrings, `" "`) + `"`
}
}
if rec.Type == "SRV" {
r.Data = cfSrvData(rec)
r.Name = rec.GetLabelFQDN()