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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user