mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
CLOUDFLAREAPI: Fix quoted TXT bug (#1538)
* Cleanup * add GetTargetQuotedRFC1038 * wip! * The RFC is 1035
This commit is contained in:
@ -91,6 +91,10 @@ func (rc *RecordConfig) zoneFileQuoted() string {
|
|||||||
return full[len(header):]
|
return full[len(header):]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rc *RecordConfig) GetTargetRFC1035Quoted() string {
|
||||||
|
return rc.zoneFileQuoted()
|
||||||
|
}
|
||||||
|
|
||||||
// GetTargetSortable returns a string that is sortable.
|
// GetTargetSortable returns a string that is sortable.
|
||||||
func (rc *RecordConfig) GetTargetSortable() string {
|
func (rc *RecordConfig) GetTargetSortable() string {
|
||||||
return rc.GetTargetDebug()
|
return rc.GetTargetDebug()
|
||||||
|
@ -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.GetTargetRFC1035Quoted()
|
||||||
}
|
}
|
||||||
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,7 @@ 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.GetTargetRFC1035Quoted()
|
||||||
r.Content = `"` + strings.Join(rec.TxtStrings, `" "`) + `"`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if rec.Type == "SRV" {
|
if rec.Type == "SRV" {
|
||||||
r.Data = cfSrvData(rec)
|
r.Data = cfSrvData(rec)
|
||||||
|
Reference in New Issue
Block a user