INWX: fix apex domains (#1221)

INWX has changed their API to use an empty string () instead of
the common @. Fix that by converting between the two.
This commit is contained in:
Sven Peter 2021-07-25 17:51:27 +02:00 committed by GitHub
parent a6b9609cd5
commit f63302b978
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,11 +161,16 @@ func newInwxDsp(m map[string]string, metadata json.RawMessage) (providers.DNSSer
func makeNameserverRecordRequest(domain string, rec *models.RecordConfig) *goinwx.NameserverRecordRequest {
content := rec.GetTargetField()
name := rec.GetLabel()
if name == "@" {
name = ""
}
req := &goinwx.NameserverRecordRequest{
Domain: domain,
Type: rec.Type,
Content: content,
Name: rec.GetLabel(),
Name: name,
TTL: int(rec.TTL),
}
@ -299,6 +304,9 @@ func (api *inwxAPI) GetZoneRecords(domain string) (models.Records, error) {
var records = []*models.RecordConfig{}
for _, record := range info.Records {
if record.Name == "" {
record.Name = "@"
}
if record.Type == "SOA" {
continue
}