mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-11 01:47:53 +08:00
Fix DNSimple crashes on Alias: (#322)
* Fix https://github.com/StackExchange/dnscontrol/issues/321
This commit is contained in:
parent
1097c96fcc
commit
e266e953d9
2 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,7 @@ import (
|
||||||
// TLSA
|
// TLSA
|
||||||
// TXT
|
// TXT
|
||||||
// Pseudo-Types:
|
// Pseudo-Types:
|
||||||
// ALIAs
|
// ALIAS
|
||||||
// CF_REDIRECT
|
// CF_REDIRECT
|
||||||
// CF_TEMP_REDIRECT
|
// CF_TEMP_REDIRECT
|
||||||
// FRAME
|
// FRAME
|
||||||
|
|
|
@ -84,6 +84,9 @@ func (c *DnsimpleApi) GetDomainCorrections(dc *models.DomainConfig) ([]*models.C
|
||||||
}
|
}
|
||||||
rec.SetLabel(r.Name, dc.Name)
|
rec.SetLabel(r.Name, dc.Name)
|
||||||
switch rtype := r.Type; rtype {
|
switch rtype := r.Type; rtype {
|
||||||
|
case "ALIAS":
|
||||||
|
rec.Type = r.Type
|
||||||
|
rec.SetTarget(r.Content)
|
||||||
case "MX":
|
case "MX":
|
||||||
if err := rec.SetTargetMX(uint16(r.Priority), r.Content); err != nil {
|
if err := rec.SetTargetMX(uint16(r.Priority), r.Content); err != nil {
|
||||||
panic(errors.Wrap(err, "unparsable record received from dnsimple"))
|
panic(errors.Wrap(err, "unparsable record received from dnsimple"))
|
||||||
|
|
Loading…
Reference in a new issue