Fix DNSimple crashes on Alias: (#322)

* Fix https://github.com/StackExchange/dnscontrol/issues/321
This commit is contained in:
Tom Limoncelli 2018-02-27 09:38:39 -05:00 committed by GitHub
parent 1097c96fcc
commit e266e953d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -25,7 +25,7 @@ import (
// TLSA
// TXT
// Pseudo-Types:
// ALIAs
// ALIAS
// CF_REDIRECT
// CF_TEMP_REDIRECT
// FRAME

View file

@ -84,6 +84,9 @@ func (c *DnsimpleApi) GetDomainCorrections(dc *models.DomainConfig) ([]*models.C
}
rec.SetLabel(r.Name, dc.Name)
switch rtype := r.Type; rtype {
case "ALIAS":
rec.Type = r.Type
rec.SetTarget(r.Content)
case "MX":
if err := rec.SetTargetMX(uint16(r.Priority), r.Content); err != nil {
panic(errors.Wrap(err, "unparsable record received from dnsimple"))